在LightGBM中,可以设置predict_contrib=True来预测SHAP值。model = LGBM(objective="binary",is_unbalance=True,predict_contrib=True) model.fit(X_train,y_train 浏览0提问于2020-11-11得票数3 回答已采纳 2回答 LightGBM中不平衡数据集的情感分析
Optimal parameters for the best estimator * {'boosting_type': 'gbdt', 'class_weight': None, 'colsample_bytree': 0.5989147519171187, 'importance_type': 'split', 'is_unbalance': True, 'learning_rate': 0.1, 'max_depth': -1, 'min_child_samples': 152, 'min_child_weight': 0.01, 'min...
'is_unbalance': True, 'boost_from_average': False, } train_data = lgb.Dataset(data=train,label=y_train) test_data = lgb.Dataset(data=test,label=y_test) num_round = 5000 clf = lgb.train(param, train_data, num_round, valid_sets = test_data, verbose_eval=250, early_stopping_rounds...