Comparing model parameters for the Iris and housing datasets
The key difference between the Iris dataset and this housing dataset is that the target parameter in the Iris dataset is a category, whereas in the housing dataset, it is a numeric parameter. Predicting a category is a classification problem, and in this chapter, you did a regression problem. That meant using a different method within XGBoost. This table compares the XGBoost training and inference calls used in Chapter 2 and in this chapter:
Iris dataset classification from Chapter 2 |
California housing dataset regression from Chapter 4 |
|
Set up the XGBoost model |
model = xgb.XGBClassifier(eval_metric="auc") |
model=xgb.XGBRegressor() |
Train the XGBoost model |
model.fit(X_train,y_train, eval_set=[(X_test,y_test... |