PyCEbox icon indicating copy to clipboard operation
PyCEbox copied to clipboard

"frac_to_plot" parameter in ice_plot

Open andrew-cho opened this issue 6 years ago • 1 comments

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

andrew-cho avatar Nov 06 '19 16:11 andrew-cho

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.

busbykt avatar Feb 13 '20 00:02 busbykt