Evaluating the XGBoost classification model
To evaluate our BigQuery ML model, we'll use a ML.EVALUATE
function and the table that we've expressly created as an evaluation dataset.
The following query will tell us if the model is suffering from overfitting or is able to also 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 `10_nyc_trees_xgboost.xgboost_classification_model_version_3`, ( SELECT ...