Skip to content

Commit

Permalink
Use latest API of XGBoost
Browse files Browse the repository at this point in the history
  • Loading branch information
hcho3 committed Oct 2, 2024
1 parent e2b6006 commit 90ae57d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions qa/L0_e2e/generate_example_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,10 @@ def train_xgboost_classifier(data, labels, depth=25, trees=100):
training_params = {
"eval_metric": "error",
"objective": "binary:logistic",
"tree_method": "gpu_hist",
"tree_method": "hist",
"device": "cuda",
"max_depth": depth,
"n_estimators": trees,
"use_label_encoder": False,
"predictor": "gpu_predictor",
}
model = xgb.XGBClassifier(**training_params)

Expand Down Expand Up @@ -192,10 +191,10 @@ def train_xgboost_regressor(data, targets, depth=25, trees=100):

training_params = {
"objective": "reg:squarederror",
"tree_method": "gpu_hist",
"tree_method": "hist",
"device": "cuda",
"max_depth": depth,
"n_estimators": trees,
"predictor": "gpu_predictor",
}
model = xgb.XGBRegressor(**training_params)

Expand Down

0 comments on commit 90ae57d

Please sign in to comment.