liqian 1 year ago
parent
commit
847c2c496f
1 changed files with 5 additions and 3 deletions
  1. 5 3
      ad_xgboost_train.py

+ 5 - 3
ad_xgboost_train.py

@@ -33,9 +33,11 @@ def xgboost_train():
     # 4. 模型训练
     xgb_model = XGBClassifier(
         objective='binary:logistic',
-        learning_rate=0.3,
-        max_depth=5,
-        eval_metric=['mae', 'auc']
+        learning_rate=0.05,
+        max_depth=9,
+        min_child_weight=8,
+        n_estimators=450,
+        eval_metric=['error', 'auc']
     )
     xgb_model.fit(x_train, y_train, eval_set=[(x_train, y_train), (x_test, y_test)])
     # 5. 模型保存