一、LGBM 模型结果 图形展示:
1、模型训练
train_x = train[feas_x]
train_y= train['target'].astype(int).copy()
test_x, test_y = test[feas_x], test['target']
lgb_clf = lgb.LGBMClassifier(objective='binary',metric='auc',num_leaves=20,max_depth=2,learning_rate=0.06,seed=27,
colsample_bytree=0.7,subsample=0.7,n_estimators=500)
lgb_model = lgb_clf.fit(train_x, train_y, eval_set=[(test_x, test_y)], early_stopping_rounds=200)
2、打印树让其用以下图片方式展示
画图方法一:
使用 Graphvizjar画图
2.1 下载 Graphvizjar
该网址(Download | Graphviz )下载自己需要的Graphvizjar 版本 ,本示例用的是 graphviz-3.0.0(64.bit)