-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
ks_abc when run with plot=False still plots the graph #147
Comments
I think I understand why this happens (and I assume you run this on a Jupyter notebook too). I'll work on a fix for this soon. |
Ok, so I'm taking back what I wrote, this isn't a bug. This behavior occurs when you run this on Jupyter notebook, and is the result of Jupyter's behavior of displaying If you wish to force Jupyter not to display it, simply add a If this happens outside of Jupyter notebook, let me know. |
@shakedzy, Thanks for your reply. As I mentioned in my original post, I am trying to use it as a function to return a scalar for ks_abc which in turn I intend to package as a metric with make_scorer(). I will then use the metric to score and evaluate models and in hp tuning. I can't imagine where I should add a Would it not make sense to not output ax as part of the dict at all within the function at all if plot=False? Taking it a step further, would it not be possible for the function to not even generate ax at all if it doesn't need to plot? That would make it more efficient when used to simply return the ks_abc value, wouldn't it? I hope I have clarified my need. I trust you will agree and advise how I can achieve this. Regards |
Hey Narayan, it will be great if you can post the function you developed here, so I can try to figure out what the issue is |
Hi @shakedzy, here you go!
Later, I wrap it as below:
and use it as a metric in HP tuning. Hope this helps. Regards |
Please provide a full script I can run |
This seemed to work for me:
When Original source for solution. Great package btw! Thanks! |
Thanks for the suggestion, @Socvest. Your workaround does seem to arrest the problem and reduce run time significantly. I've included it below in the code for comparison but commented it out to highlight the initial problem. Here you go @shakedzy !
Note that for each of the 10 fits in the example above, it generates a ks_abc chart in jupyter, which takes up significant memory and processing time. The call to ks_abc_score function adds another chart! Hope this helps in getting to a fix. Regards |
hey @RNarayan73 - thanks for the script. I just ran it on Jupyter Lab, and indeed got several plots. I ran the exact same thing from a Python console and a as Python script, and got no plots at all. This again concludes that the issue here is not |
Hi @shakedzy thanks for looking into this. |
hey @RNarayan73 - the point of The point here is that the issue is due to the framework used, not he library. BUT. - I did thought of a way to fix this. Keep following! |
hey @RNarayan73 - install from source from this PR and let me know if it works. verify you installed correctly by running: import dython
print(dython.__version__) This should yield |
Excellent, @shakedzy. It works fine now. However, installing it via pip forced an update to numpy 1.24. Regards, |
…alse-still-plots-the-graph Fixing issue #147
Version check:
Run and copy the output:
this is strange, as I checked conda list to confirm that I have 0.7.3 installed
Describe the bug:
I would like to use the ks_abc function as a metric via make_scorer(). All I want is a scalar output for the abc value.
However, when called as a standalone function with plot=False as shown below, it still shows the plot (in addition to the abc value) in jupyter.
When called as a standalone function without plot=False argument, it shows the plot, but doesn't show the requested value from the dict.
Code to reproduce:
Error message:
There is no error message. It simply draws the plot in addition to the scalar value from the output dict even when plot=False.
Input data:
The text was updated successfully, but these errors were encountered: