1

1.环境信息

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

2.错误信息:

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()
4

1 回答 1

1

请点击此链接:https ://github.com/Microsoft/LightGBM/issues/615 。根据贡献者的说法,这是一个小错误:json 无法处理无限数。

于 2017-06-13T05:44:25.643 回答