Yu Gu
Yu Gu

Reputation: 2503

How to set the frequency of metric output in lightGBM?

In the documents, it is said that we can set the parameter metric_freq to set the frequency. I have also tried the parameter verbose, the parameters are set as

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
}

However, I still got the result as following,

[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

Which showed that the parameter metric_freq didn't work at all. So which parameter is used to set the frequency of output?
In R, we can use eval_freq, but there is no eval_freq parameter in python wrapper!

Upvotes: 6

Views: 2518

Answers (1)

Andy Harless
Andy Harless

Reputation: 66

Try giving verbose_eval=10 as a keyword argument (rather than in params).

Upvotes: 5

Related Questions