问题
I'm trying to plot a learning curve for the CatBoostClassifier. The error occurs when I fit the CatBoostClassifier into LearningCurve from yellowbrick. I think this should work since CatBoost is sklearn compatible and yellow brick is a sklearn extension.
Code snippet:
kf = RepeatedStratifiedKFold(n_splits=10, n_repeats=3, random_state=0)
sizes = np.linspace(0.2, 1.0, 10)
estimator = CatBoostClassifier(
iterations=42, learning_rate=0.3, max_depth=10)
visualizer = LearningCurve(
estimator, cv=kf, scoring='accuracy', train_sizes=sizes, n_jobs=-1
)
visualizer.fit(X, y)
visualizer.show()
Error:
... yellowbrick.exceptions.YellowbrickTypeError: Cannot detect the model name for non estimator: ''
Any suggestions?
回答1:
I could plot a learning curve for XGBClassifier, I think it should also work for CatBoostClassifier. visualizer.show() won't work though. Use visualizer.poof() to render the plot.
来源:https://stackoverflow.com/questions/61966426/plot-learning-curve-of-catboostclassifier-with-yellowbrick