|
@@ -33,7 +33,7 @@ xgb_model = XGBClassifier(
|
|
|
objective='binary:logistic',
|
|
|
learning_rate=0.3,
|
|
|
max_depth=5,
|
|
|
- eval_metric=['error', 'logloss', 'auc']
|
|
|
+ eval_metric=['mae', 'auc']
|
|
|
)
|
|
|
xgb_model.fit(x_train, y_train, eval_set=[(x_train, y_train), (x_test, y_test)])
|
|
|
# 5. 模型保存
|
|
@@ -51,3 +51,9 @@ test_accuracy = metrics.accuracy_score(y_test, y_test_pre)
|
|
|
print("Test Accuracy: %.2f%%" % (test_accuracy * 100.0))
|
|
|
test_auc = metrics.roc_auc_score(y_test, y_test_pre)
|
|
|
print("auc: %.2f%%" % (test_auc * 100.0))
|
|
|
+test_recall = metrics.recall_score(y_test, y_test_pre)
|
|
|
+print("recall:%.2f%%"%(test_recall*100.0))
|
|
|
+test_f1 = metrics.f1_score(y_test, y_test_pre)
|
|
|
+print("f1:%.2f%%"%(test_f1*100.0))
|
|
|
+test_precision = metrics.precision_score(y_test, y_test_pre)
|
|
|
+print("precision:%.2f%%"%(test_precision*100.0))
|