You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I was trying to combine the KElbowVisualizer with VisualPipeline but was stuck getting the unexpected error below:
AttributeError: 'KMeans' object has no attribute 'axes'
The important part is that I was trying to run pipe.fit_transform_show(X). Of course, pipe.fit(X); pipe.show() worked fine, and was similar to the usage in KElbowVisualizer's example.
The issue
The issue is that VisualPipeline will try to call KElbowVisualizer.fit_transform, which does not exist. Due to Wrapper, KMeans.fit_transform will be executed instead, which means that KElbowVisualizer.fit is never called.
Feature request
The main problem was my rush to get it all in one line, fit_transform_show(). I still think though it's an honest usage and might be tried by other people. Some ideas came in mind to improve this usage:
Better documentation and more examples about VisualPipeline. It's a nice feature, but I was only able to find brief referentes to it such as in Classification Visualizers.
Have VisualPipeline implementing a fit_show(X) method. This would probably yield more confusion, but has the nice property of not returning the undesired transformed output (when compared to fit_transform_show).
FeatureVisualizer currently implements sklearn's TransformerMixin, but ModelVisualizer does not. In contrast, KMeans, although an estimator, also implements the TransformerMixin. ModelVisualizer (or simply Visualizer) implementing the TransformerMixin would force the call of KElbowVisualizer().fit().transform().
3.1. A complementary approach would be ModelVisualizer implementing an empty transform method. This would allow us to apply KElbowVisualizer.fit_transform_show() without getting back an array of distances (from KMeans.transform)
I don't know the impact in the other ModelVisualizer's or on VisualPipeline usages, but I'd be glad to help implementing these or other ideas to improve VisualPipeline.
The text was updated successfully, but these errors were encountered:
@falcaopetri thank you for contributing to Yellowbrick and for reporting the issue that you're having with the VisualPipeline. I know that the VisualPipeline needs a lot of love, it's more or less a prototype and has not really risen to the level of core functionality in Yellowbrick quite yet. All of your suggestions are excellent though! If you're interested in a second PR after we get through #1202 - we'd be happy to review your work!
Is your feature request related to a problem? Please describe.
I was trying to combine the
KElbowVisualizer
withVisualPipeline
but was stuck getting the unexpected error below:Full pipeline snippet
The important part is that I was trying to run
pipe.fit_transform_show(X)
. Of course,pipe.fit(X); pipe.show()
worked fine, and was similar to the usage inKElbowVisualizer
's example.The issue
The issue is that
VisualPipeline
will try to callKElbowVisualizer.fit_transform
, which does not exist. Due toWrapper
,KMeans.fit_transform
will be executed instead, which means thatKElbowVisualizer.fit
is never called.Feature request
The main problem was my rush to get it all in one line,
fit_transform_show()
. I still think though it's an honest usage and might be tried by other people. Some ideas came in mind to improve this usage:VisualPipeline
. It's a nice feature, but I was only able to find brief referentes to it such as in Classification Visualizers.VisualPipeline
implementing afit_show(X)
method. This would probably yield more confusion, but has the nice property of not returning the undesired transformed output (when compared tofit_transform_show
).FeatureVisualizer
currently implements sklearn'sTransformerMixin
, butModelVisualizer
does not. In contrast,KMeans
, although an estimator, also implements theTransformerMixin
.ModelVisualizer
(or simplyVisualizer
) implementing theTransformerMixin
would force the call ofKElbowVisualizer().fit().transform()
.3.1. A complementary approach would be
ModelVisualizer
implementing an emptytransform
method. This would allow us to applyKElbowVisualizer.fit_transform_show()
without getting back an array of distances (fromKMeans.transform
)I don't know the impact in the other
ModelVisualizer
's or onVisualPipeline
usages, but I'd be glad to help implementing these or other ideas to improveVisualPipeline
.The text was updated successfully, but these errors were encountered: