Training the XGBoost classification model
Now that we've segmented the dataset into multiple tables to support the different stages of the ML model life cycle, let's focus on the training of our XGBoost classification model. Follow these steps:
- Let's start with training our first ML model,
xgboost_classification_model_version_1
, as follows:CREATE OR REPLACE MODEL `10_nyc_trees_xgboost.xgboost_classification_model_version_1` OPTIONS Â Â ( MODEL_TYPE='BOOSTED_TREE_CLASSIFIER', Â Â Â Â BOOSTER_TYPE = 'GBTREE', Â Â Â Â NUM_PARALLEL_TREE = 1, Â Â Â Â MAX_ITERATIONS = 50, Â Â Â Â TREE_METHOD = 'HIST', Â Â Â Â EARLY_STOP = FALSE, Â Â Â Â AUTO_CLASS_WEIGHTS=TRUE Â Â ) AS SELECT Â Â zip_city, Â Â tree_dbh, Â Â spc_latin as label FROM Â Â `10_nyc_trees_xgboost.training_table` ;
In this BigQuery ML statement...