Python catboost二进制分类:训练和测试日志损失计算不一致?
我正在使用Catboost解决一个二进制分类问题。我的数据集有5列(所有5列都是类别)。我将数据集分为两组(X1,y1)和(X2,y2)。这是我的密码:Python catboost二进制分类:训练和测试日志损失计算不一致?,python,machine-learning,catboost,Python,Machine Learning,Catboost,我正在使用Catboost解决一个二进制分类问题。我的数据集有5列(所有5列都是类别)。我将数据集分为两组(X1,y1)和(X2,y2)。这是我的密码: import catboost catboost_model = catboost.CatBoostClassifier(iterations=150, learning_rate=0.5, depth=4, loss_function='Logloss', eval_metric='Loglos
import catboost
catboost_model = catboost.CatBoostClassifier(iterations=150, learning_rate=0.5, depth=4,
loss_function='Logloss', eval_metric='Logloss', thread_count=4)
catboost_model.fit(X1, y1, cat_features=X_columns, eval_set=[(X1, y1)], verbose=True, use_best_model=True)
请注意,我的验证集(测试集)与训练集相同。我原以为列车和试验的对数损耗计算相同,但以下是输出(前10行):
为什么“学习”logloss与“测试”logloss不同?我使用的是与列车和测试相同的(X1,y1)
0: learn: 0.4785917 test: 0.4785909 best: 0.4785909 (0) total: 137ms remaining: 20.4s
1: learn: 0.4050160 test: 0.4049414 best: 0.4049414 (1) total: 184ms remaining: 13.7s
2: learn: 0.3747240 test: 0.3746158 best: 0.3746158 (2) total: 213ms remaining: 10.5s
3: learn: 0.3604948 test: 0.3603708 best: 0.3603708 (3) total: 243ms remaining: 8.87s
4: learn: 0.3536384 test: 0.3535104 best: 0.3535104 (4) total: 272ms remaining: 7.88s
5: learn: 0.3474158 test: 0.3450169 best: 0.3450169 (5) total: 310ms remaining: 7.44s
6: learn: 0.3448010 test: 0.3412129 best: 0.3412129 (6) total: 342ms remaining: 6.99s
7: learn: 0.3416549 test: 0.3383577 best: 0.3383577 (7) total: 376ms remaining: 6.67s
8: learn: 0.3398553 test: 0.3363817 best: 0.3363817 (8) total: 407ms remaining: 6.38s
9: learn: 0.3391258 test: 0.3357344 best: 0.3357344 (9) total: 442ms remaining: 6.19s
...