how to extract decision rules of GradientBosstingC

2020-04-21 04:12发布

I want to extract and visualize the decision rules of a scikit-learn GradientBoostingClassifier. If it were just one DecisionTreeClassifier I'd use tree.export_graphviz, but GradientBoostingClassifier is an ensemble of trees. I don't know how I'd use export_graphviz on them.

If anyone knows of a way to do so, it will be very helpful.

1条回答
相关推荐>>
2楼-- · 2020-04-21 05:11

Someone has solved the problem. "You can use clf.estimators_ to retrieve the DecisionTreeRegressor objects corresponding to each boosting stage and call export_graphviz to generate the tree visualization.. http://scikit-learn.org/stable/modules/generated/sklearn.ensemble.GradientBoostingClassifier.html"

查看更多
登录 后发表回答