Evaluating the binary logistic regression model
To evaluate our BigQuery ML model, we'll use the ML.EVALUATE
function and the table that we've expressly created as the evaluation dataset.
The following query will tell us whether the model is suffering from overfitting or is also able to perform well on new data:
SELECT roc_auc, CASE WHEN roc_auc > .9 THEN 'EXCELLENT' WHEN roc_auc > .8 THEN 'VERY GOOD' WHEN roc_auc > .7 THEN 'GOOD' WHEN roc_auc > .6 THEN 'FINE' WHEN roc_auc > .5 THEN 'NEEDS IMPROVEMENTS' ELSE 'POOR' END AS model_quality FROM ML.EVALUATE(MODEL `05_chicago_taxi.binary_classification_version_5`, ( SELECT ...