-
-
Notifications
You must be signed in to change notification settings - Fork 562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow ModelVisualizers to wrap Pipeline objects #498
Comments
Dear Mentor @bbengfort , I am very interested in this Project for Brief introductionFirst of all, I would like to introduce my understanding of the project. Since I am just beginning to get familiar with this project, there may be some mistakes in my understanding. If there is something wrong with my understanding, I really hope you can correct it. Yellowbrick's core concept is to better assist decision-making in various processes of machine learning through a visual approach. So the The root of the visual object
The relationship of them in UML is like this: The Feather: Allow ModelVisualizers to wrap Pipeline objectsIn the above, you describe that the The relationship of them is like this: Current StatusI read the source code, and the code shows that the current implementation is: when passing a pipeline object to the My QuestionQ1: Do you mean we want that Q2: The source code of I'm sorry that I wrote a little too much, but it is for the purpose of clearer expression and communication. If my question is too simple, please forgive me. You know, everyone has a beginning. Thank you for your time and patient. Looking for your replay. Thank you and best regards! |
Respected Mentors @rebeccabilbro @bbengfort @lwgray @ndanielsen @pdamodaran @wagner2010, |
Hi @Yogayu wow this is great! Thanks so much for your work here in such a short period of time. I also did see your posts on the Google group which I will be responding to shortly. Because, as you mentioned, time is running short and because we’re not available to respond in detail please go ahead and incorporate this into your proposal and submit it. We believe you’re on the right track for a strong proposal and we’re not expecting perfection so much as seeing your code and your vision for this problem. Regardless of the outcome as it relates to GSoC we welcome your involvement with Yellowbrick! Thanks and stay well. |
@wagner2010 I understand. Thank you. |
Describe the solution you'd like
Our model visualizers expect to wrap classifiers, regressors, or clusters in order to visualize the model under the hood; they even do checks to ensure the right estimator is passed in. Unfortunately in many cases, passing a pipeline object as the model in question does not allow the visualizer to work, even though the model is acceptable as a pipeline, e.g. it is a classifier for classification score visualizers (more on this below). This is primarily because the Pipeline wrapper masks the attributes needed by the visualizer.
I propose that we modify the
ModelVisualizer
to change theModelVisualizer.estimator
attribute to a@property
- when setting the estimator property, we can perform a check to ensure that the Pipeline has afinal_estimator
attribute (e.g. that it is not a transformer pipeline). When getting the estimator property, we can return the final estimator instead of the entire Pipeline. This should ensure that we can use pipelines in our model visualizers.NOTE however that we will still have to
fit()
,predict()
, andscore()
on the entire pipeline, so this is a bit more nuanced than it seems on first glance. There will probably have to beis_pipeline()
checking and other estimator access utilities.Is your feature request related to a problem? Please describe.
Consider the following, fairly common code:
This seems to be a valid model for a classification report, unfortunately the classification report is not able to access the MLPClassiifer's
classes_
attribute since the Pipeline doesn't know how to pass that on to the final estimator.I think the original idea for the
ScoreVisualizers
was that they would be inside of Pipelines, e.g.But this makes it difficult to use more than one visualizer; e.g. ROCAUC visualizer and CR visualizer.
Definition of Done
ModelVisualizer
class with pipeline helpersThe text was updated successfully, but these errors were encountered: