My goal is to visualize the results of a gradient boosting classifier.
from sklearn.ensemble import GradientBoostingClassifier
clf_gbc = GradientBoostingClassifier(random_state=42)
pipe = Pipeline(steps=[('SELECT', selector), ('GBC', clf_gbc)])
parameters_gbc = {'GBC__min_samples_split': [1, 5, 10, 15, 20, 25, 30],
'GBC__max_depth': [3,4,5,6,7,8],
'GBC__min_samples_leaf': [1, 5, 10, 15, 25, 30]}
grid = GridSearchCV(estimator=pipe, param_grid=parameters_gbc, cv=cv, scoring = 'f1')
grid.fit(features_train, labels_train)
clf=grid.best_estimator_
import pydotplus
dot_data = tree.export_graphviz(clf, out_file=None)
graph = pydotplus.graph_from_dot_data(dot_data)
graph.write_pdf("gbc.pdf")
I get the error ImportError: No module named pydotplus
. I installed pydotplus using pip install pydotplus
.
Any help on this or on how to visualize the results of a gradient boosting classifier would be appreciated!