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 Â Â Â Â Â Â Â ...