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
bug: test_visualization.py::test_visualization_calibration_1_vs_all_output_saved fails with IndexError in seaborn regplot() function #620
Comments
I doubt there'll be any be repercussions to changing to seaborn <= 0.9.0. So it should be okay. @w4nderlust |
I think it is worth fixing the specific function call and testing seaborn 0.10, we don't want to keep hooked to older versions. |
@msaisumanth @w4nderlust While I work on the fix to support Once the |
Makes sense @jimthompson5802 , thank you! |
I actually added it myself. I'll keep the issue open anyway, because I prefer to adapt to whatever API change seaborn did in 0.10.0 as a more sustainable solution moving forward. |
OK..I focus on the long-term fix to support |
I've been working on this a bit, made some discoveries and pushed some code: 997c6bc
It is probably related to the fact that there are nans in the matrix to invert, but I'm not 100 sure how nans end up there in the CLI case and not in the API case. |
I pulled down your commit |
@w4nderlust I instrumented the function Re: your observation that the api test succeeds but the cli version fails with this error From what I can tell the api and cli tests create the same synthetic data set for the tests. In case of the cli test the probabilities passed to In case of the api test the probabilities passed to I was expecting the structure of the probabilities matrix to be similar but they seem to be different. What should the structure of the probabilities matrix? Since the api version works, I'm thinking the first two columns contain the predicted probability for that particular class. The 3rd column could be the probability for the predicted class. Does this observation point to a direction to resolve this issue? |
The structure is the same, although the distributions are very different. In the second case there's something weird as they don't look like probabilities, i.e. the rows don't sum up to 1... But that's the one that works surprisingly enough. |
@w4nderlust I have an explanation for this issue you pointed out re: the api test:
I believe the issue is due to an error in the
This is the For this particular, I believe the correct specification should have been Unless I hear otherwise, I'll be make the change to refer to the correct columns. I'll make sure that the modifications should handle any number of probabilities and not hard coded to three columns. |
@w4nderlust I may have found root cause for this issue. In a nutshell the issue occurs when generating calibration plots for the From what I can see, the plot points for the By eliminating the
Is it necessary to generate the If eliminating the Let me know If the fix is reasonable. If it is, I'll submit the PR for review. |
For completeness, tested the recommended fix with
|
@w4nderlust peeled back another layer of the onion. I know understand why the
This results in order = 2. This results in fitting a quadratic to two points. The OTOH if order is calculated as follows:
This results in order = 1. With this setting,
If it makes sense to print the calibration plot for class For the record here are the plots generated using the modified |
Yes this is exactly the intended behavior, you spotted the bug of the -1 being inside |
Describe the bug
Unit test
fails with
IndexError
exception in the travis ci run and locally for me in a docker container:To Reproduce
Steps to reproduce the behavior:
Any PR submitted after 24Jan2020 should exhibit the problem
Expected behavior
Unit test should not fail
Screenshots
See above
Environment (please complete the following information):
Failure occurs in two environments. It fails in my local development environment.
Failure also occurs in the travis-ci environment
Additional context
After staring at this issue for a few days, it appears the error may be related to the version of the
seaborn
package. When the unit test is run usingseaborn 0.9.0
, the test completes successfully. However, whenseaborn 0.10.0
is installed, the test fails with the cited error message. I've confirmed this observation through local testing, i.e.,seaborn 0.9.0
=> unit test completes successfullyseaborn 0.10.0
=> unit test failsNote: unit test also fails with
seaborn 0.9.1
seaborn 0.10.0
was released on PyPi on 2020-01-24.seaborn 0.9.0
was released 2018-07-16. Prior to mid-January 2020, I did not encounter any issues in running thepytest
suite of tests.seaborn 0.10.0
release notes indicate changes were made to theregplot()
function, which is the one failing in ludwig's unit test. I can't tell if the issue we are seeing is due to a breaking api in theseaborn
0.10.0 api or a bug in 0.10.0 code base. More analysis is required.Since the requirements file used to build the travis-ci environment specifies
seaborn>=0.7
, this meanspip install
will use the most recent version of seaborn greater than 0.7. This results in installingseaborn 0.10.0
. The implication is that any PR submitted from this point on will fail in the cited unit test.A possible short-term work-around for the travis-ci run failures is to update
requirements_viz.txt
to replace the currentseaborn
specification fromseaborn>=0.7
withseaborn>=0.7,<=0.9.0
. If this is acceptable, I'll submit a PR to effect the change.The text was updated successfully, but these errors were encountered: