BorgwardtLab / maldi_amr

Code for the paper "Antimicrobial resistance prediction in clinical isolates through machine learning on MALDI-TOF mass spectra"
BSD 3-Clause "New" or "Revised" License
30 stars 10 forks source link

Issue with histogram function #1

Closed olavolav closed 2 years ago

olavolav commented 2 years ago

Not really an issue, but I noticed you are using my uniplot library and added a comment that something was not working as you expected.

https://github.com/BorgwardtLab/maldi_amr/blob/8ce815ef43b07357e27b6ba171d68319af6af28e/amr_maldi_ml/predict_on_metadata.py#L244-L252

I was just curious what that problem might have been? I'd be interested in potentially improving the histogram function

Pseudomanifold commented 2 years ago

Thanks a lot for this awesome library! I think v0.7.0 works as expected now, but earlier versions had an issue with cutting of values. I cannot reproduce this any more with the most recent version:

                   Prediction Probabilities
┌────────────────────────────────────────────────────────────┐
│ ▛▀▀▀▀▀▜                                                    │ 
│ ▌     ▐                                                    │ 800
│ ▌     ▐                                                    │ 
│ ▌     ▐                                                    │ 
│ ▌     ▐                                                    │ 
│ ▌     ▐                                                    │ 
│ ▌     ▐                                                    │ 
│ ▌     ▐                                                    │ 
│ ▌     ▐                                                    │ 
│ ▌     ▐                                                    │ 400
│ ▌     ▐▄▄▄▄▄▄▖                                             │ 
│ ▌            ▌                                             │ 
│ ▌            ▌                                             │ 
│ ▌            ▌                                             │ 
│              ▌                                             │ 
│              ▙▄▄▄▄▄▄                                       │ 
│▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▐▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄│ 0
└────────────────────────────────────────────────────────────┘
0.5          0.51           0.52          0.53           0.54

I'll update the code accordingly.

olavolav commented 2 years ago

Perfect, thanks!