文档中说我们可以设置参数metric_freq来设置频率。我也试过参数verbose,参数设置为
params = {
'task': 'train',
'boosting_type': 'gbdt',
'objective': 'binary',
'metric': { 'binary_logloss'},
'metric_freq':10,
'num_leaves': 511,
'max_depth':8,
'learning_rate': 0.1,
'feature_fraction': 1,
'bagging_fraction': 0.8,
'bagging_freq': 1,
'verbose':10
}
但是,我仍然得到如下结果,
[1] valid_0's binary_logloss: 0.607487
Train until valid scores didn't improve in 5 rounds.
[2] valid_0's binary_logloss: 0.537403
[3] valid_0's binary_logloss: 0.479081
[4] valid_0's binary_logloss: 0.429961
[5] valid_0's binary_logloss: 0.388182
[6] valid_0's binary_logloss: 0.35239
[7] valid_0's binary_logloss: 0.321529
[8] valid_0's binary_logloss: 0.294795
[9] valid_0's binary_logloss: 0.271543
[10] valid_0's binary_logloss: 0.251267
[11] valid_0's binary_logloss: 0.233531
[12] valid_0's binary_logloss: 0.217997
[13] valid_0's binary_logloss: 0.204344
这表明参数 metric_freq 根本不起作用。那么哪个参数是用来设置输出频率的呢?
在 R 中,我们可以使用 eval_freq,但是 python 包装器中没有 eval_freq 参数!