Skip to content
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

RadViz does not plot when transform is called #793

Closed
naresh-bachwani opened this issue Mar 24, 2019 · 7 comments
Closed

RadViz does not plot when transform is called #793

naresh-bachwani opened this issue Mar 24, 2019 · 7 comments
Assignees
Labels
type: bug something isn't working type: technical debt work to optimize or generalize code

Comments

@naresh-bachwani
Copy link
Contributor

Describe the bug
I wanted to fit the model on the dataset and obtain its plot by using transform function on their subset. While working with RadViz, I found that it plots the graph when fit method is called. However, it should plot the output, when the transform method is implemented as described in the domentation. Moreover, I did not get the desired result (i.e. plotting) when transform method is called.
I was able to get these results using 'Rank1D,' but 'RadViz' did not work.

Output with Rank1D
Screenshot (122)

Output with RadViz
Screenshot (123)

To Reproduce

from yellowbrick.features import Rank1D
from yellowbrick.features import RadViz
fig=plt.figure()
visualizer = RadViz(features=features,classes=classes)
visualizer.fit(X, y)                # Fit the data to the visualizer
for i in range(5):
    ax0 = fig.add_subplot(5,1,i+1)
    visualizer.ax=ax0
    visualizer.transform(X[i*100:(i+1)*100])             # Transform the data
        
fig=plt.figure()
visualizer = Rank1D(features=features, algorithm='shapiro')
visualizer.fit(X, y)                # Fit the data to the visualizer
for i in range(5):
    ax0 = fig.add_subplot(5,1,i+1)
    visualizer.ax=ax0
    visualizer.transform(X[i*100:(i+1)*100])             # Transform the data
        
        

Dataset
I used bikeshare dataset and used features = ['temp','humidity','windspeed','registered','riders'] and 'holiday' as y.

@naresh-bachwani naresh-bachwani changed the title RadViz produce output when fit is called RadViz does not plot when transform is called Mar 24, 2019
@lwgray
Copy link
Contributor

lwgray commented Mar 25, 2019

@naresh-bachwani thanks for opening this issue. We are just returning from a hiatus and will address this after catching up on our backlog of PRs and Issues.

@Kautumn06
Copy link
Contributor

Kautumn06 commented Apr 7, 2019

Hi @naresh-bachwani, thank you for your patience as we catch up with our backlog of PRs and Issues!

The bikeshare dataset is typically used with regression models to predict the continuous variable riders, so I am curious about why you've selected the binary feature holiday as your target y. Can you please share the code you used to load the bikeshare dataset and create your features and classes lists so that I can replicate what you were trying to do. Thanks!

@naresh-bachwani
Copy link
Contributor Author

naresh-bachwani commented Apr 7, 2019

Hi @Kautumn06, the dataset is used just as an example and not to obtain some explicit results. I was working with bikeshare and used one of its categorical columns to produce the output. We can use occupancy or any other dataset.
I was working on issue #507 related to the animation of feature visualizer and noticed that all feature visualizer except RadViz produce an output when transform is called.
The code for producing data is as follows:

data = load_data("bikeshare")
features = ['temp','humidity','windspeed','registered','riders']
classes = ['holiday','notholiday']
X=data[features]
y=data.holiday

where load_data is the same function from yellowbrick's example dataset in documentation

@bbengfort bbengfort added the type: technical debt work to optimize or generalize code label Apr 18, 2019
@bbengfort
Copy link
Member

@naresh-bachwani thank you for bringing this up. In order to investigate this, we'll need to remind ourselves of the API for feature visualizers, so I've labeled the issue as technical debt. In the meantime, I'll say that the most common way we use the feature visualizers is through fit_transform rather than either fit or transform. Obviously, we don't want to have our API behave strangely - but do you think that using this method would change your experience, or do you think that you might want to fit the visualizer on different data that you transform on?

Because this requires an API review, I will say that we probably won't be able to get to it for a little bit. Is this blocking your work on #507?

@naresh-bachwani
Copy link
Contributor Author

I raised this issue only to highlight this bug in the API. As far as #507 is concerned I will try using fit transform method. Thanks for help!!

@bbengfort bbengfort added the type: bug something isn't working label Aug 28, 2019
@rebeccabilbro
Copy link
Member

@naresh-bachwani @bbengfort I believe this issue has been resolved following the changes made in #973 and for #960. Now neither of these visualizers actually plots until show() is called. Can you guys confirm that this issue can be closed?

@bbengfort
Copy link
Member

@rebeccabilbro @naresh-bachwani I believe that this issue with the inconsistent API has now been fixed, and it's a matter of more deeply researching how to do multi-visualizer/multi-figure drawing. Let's go ahead and close this issue and explore it more specifically if it comes up in a different way!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug something isn't working type: technical debt work to optimize or generalize code
Projects
None yet
Development

No branches or pull requests

5 participants