Python lightgbm feature_importance() 错误?

Python lightgbm feature_importance() error?

1.Environment 信息

操作系统:Windows Python 版本:Python 2.7.13

2.Error 留言:

ValueError:无法解码 JSON 对象

lgb_train = lgb.Dataset(X_train, y_train)
lgb_eval = lgb.Dataset(X_test, y_test, reference=lgb_train)
params = {
'task':'train',
'boosting':'gbdt',
'objective':'binary',
'metric':{'l2', 'auc'},
'num_leaves': 62,
'learning_rate': 0.05,
'feature_fraction': 0.9,
'bagging_fraction': 0.8,
'bagging_freq': 5,
'verbose': 20
}
gbm = lgb.train(params,
lgb_train,
num_boost_round=250,
valid_sets=lgb_eval)

print('Start predicting...')

y_pred = gbm.predict(X_test, num_iteration=gbm.best_iteration)
y_pred = np.round(y_pred)

print gbm.feature_importance()

关注此 link:https://github.com/Microsoft/LightGBM/issues/615。根据贡献者的说法,这是一个小错误:json.

无法处理无限数