catboost 中的 Mlogloss 值开始为负值并增加

Mlogloss value in catboost starts negative and increases

我是 运行 带有 catboost 使用设置的 catboost 分类器:

model = CatBoostClassifier(iterations=1000, learning_rate=0.05, depth=7, loss_function='MultiClass',calc_feature_importance=True)

我有 5 个 类,它从 -ve 值开始,并在拟合模型时如下增加:

0:      learn: -1.5036342       test: -1.5039740        best: -1.5039740 (0)    total: 18s      remaining: 4h 59m 46s
1:      learn: -1.4185548       test: -1.4191364        best: -1.4191364 (1)    total: 37.8s    remaining: 5h 14m 24s
2:      learn: -1.3475387       test: -1.3482641        best: -1.3482641 (2)    total: 56.3s    remaining: 5h 12m 1s
3:      learn: -1.2868831       test: -1.2877465        best: -1.2877465 (3)    total: 1m 15s   remaining: 5h 12m 32s
4:      learn: -1.2342138       test: -1.2351585        best: -1.2351585 (4)    total: 1m 34s   remaining: 5h 13m 56s

这是正常行为吗?而在大多数机器学习算法中,logloss 是正的并且随着训练而降低。我在这里错过了什么?

是的,这是正常行为。

当您在模型的参数中指定 loss_function='MultiClass' 时,它会使用另一个损失函数来进行优化,而不是 LogLoss。可以找到定义here.

要理解那个函数的符号,你可以想想最好的情况和最坏的情况。在最好的情况下,对象 ai 的目标函数值全部集中在正确的 class t,因此 log 中的分数(在链接页面的公式中)等于 1,而 log将为 0。但是,当您偏离最佳情况时,log 中的分数将减少到 0,并且 log 本身会越来越消极了。