DistrictDataLabs / yellowbrick

Visual analysis and diagnostic tools to facilitate machine learning model selection.
http://www.scikit-yb.org/
Apache License 2.0
4.28k stars 557 forks source link

DiscriminationThreshold() for catboost #1317

Closed FeFortti closed 1 month ago

FeFortti commented 1 month ago
visualizer = DiscriminationThreshold(estimator, is_fitted=True, exclude="queue_rate", random_state=42)
visualizer.fit(X_val, y_val)
visualizer.show()

When I use the above code with estimators such as random forest, xgboost and lightgbm, it works perfectly.

However, when I try to use the same code for the catboost estimator, the following error appears:

YellowbrickTypeError: Cannot detect the model name for non estimator: '<class 'catboost.core.CatBoostClassifier'>'
bbengfort commented 1 month ago

@FeFortti I'm glad to hear that Yellowbrick is working for you so far!

Yellowbrick core specifically targets scikit-learn models; however, we do have a contrib module that wraps third-party estimators like the CatBoostClassifier:

https://www.scikit-yb.org/en/latest/api/contrib/wrapper.html

As you can see from the "Tested Libraries" section, the CatBoostClassifier should work with the classifier visualizer.

Hope that helps!

FeFortti commented 1 month ago

Hi, @bbengfort

Thanks for the explanation! I tried, but unfortunately, I was unable to set the parameters needed to use the wrapper.

But that's okay, I understand that I would have to be a more advanced programmer to achieve this.

Anyway, thank you very much for all your attention!

bbengfort commented 1 month ago

@FeFortti I'm sorry to hear that it didn't work for you; but thanks for trying it out!