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

"frac_to_plot" parameter in ice_plot #27

Open
andrew-cho opened this issue Nov 6, 2019 · 1 comment
Open

"frac_to_plot" parameter in ice_plot #27

andrew-cho opened this issue Nov 6, 2019 · 1 comment

Comments

@andrew-cho
Copy link

Hey Austin,

This package rocks, thanks for publishing it!

I have a question and a potential small bug in the ice_plot method, specifically on the "frac_to_plot" parameter.

It is my understanding that you simply take the fraction and multiply by the number of columns, and then pass this to the "size" parameter of np.random.choice(). I think we should make sure that the number being passed is an integer, not a float. Otherwise np.random.choice() will not accept a float as a parameter for "size".

Current:
icols = np.random.choice(n_cols, size=frac_to_plot * n_cols, replace=False)

Fix:
icols = np.random.choice(n_cols, size=int(frac_to_plot * n_cols), replace=False)

Best,
Andrew

busbykt added a commit to busbykt/PyCEbox that referenced this issue Feb 11, 2020
@busbykt
Copy link

busbykt commented Feb 13, 2020

Hey Andrew - I agree with your comments, I ran into an error due to the line you described and I was able to resolve it in the fork which I linked above. I also made a minor change to support scikit-learn model predictions of probability for classification problems (I may have broken the functionality for other uses, but I implemented the lowest hanging fruit fix for my own work. Anyway, your Fix is good as far as I can tell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants