Fix crash on int-coded label columns in ridgeline plot - #205
Merged
Merged
Conversation
Owner
|
I think the root error was the code line converting valid integer values into nan-values, which does not make sense and the comment above looks like a co-production of AI and myself: Was introduced here: bd02297 To keep the original behaviour regarding integer-based annotations like age, I suggest the following fix: |
Owner
|
We need to be careful the fix would be necessary at multiple locations in general visualizer and xmodalix visualizer |
Owner
|
@alicia01101 I have introduced my suggested fix. Please, test with the tutorials, then I will merge. |
Collaborator
Author
|
The Tutorials work with the suggested fix! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
GeneralVisualizer._plot_latent_ridgewhen coloring a Ridgeline plot by an integer-coded categorical label column (e.g. class labels) with more than 3 unique values.pd.qcutraised ValueError: Bin edges must be unique because every computed bin edge was NaN.existing quantile-binning behavior and non-numeric outliers within such columns are still coerced to NaN like before.
intvalues mixed into them then these values are no longer dropped to NaN.Limitations
the crash hasn't happend before since every other tutorial currently colors by a string-typed column (eg. cancer_type, cell_type, disease...)
however possible problem with this fix could be: a column that is integer-valued but semantically continuous (like age in years without missing values) will now be treated as categorical rather than quantile-binned
Instead of this handling it would also be possible to simply extend the numeric check to include int, not just float, to prevent the crash