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