kitzeslab / opensoundscape

Open source, scalable software for the analysis of bioacoustic recordings
http://opensoundscape.org
MIT License
139 stars 16 forks source link

Feat_categorical_labels #1053

Closed sammlapp closed 2 months ago

sammlapp commented 2 months ago

these methods replace multihot_clip_labels() and multihot_labels_like(), and support four different output formats: multihot, categorical with integers, categorical with class names, or CategoricalLabels class.

Adds CategoricalLabels class, which stores labels as lists of integers and provides methods to "view" or access the labels in various formats including sparse or dense 2d arrays or dataframes. Also provides methods to create from multihot or categorical dataframes. Will be useful for storing labels in a lightweight format when there are many classes and samples.

Adds tests for the new BoxedAnnotations methods and removes/updates outdated tests. Still needs tests for the CategoricalLabels class itself.