vak.prep.sequence_dataset.has_unlabeled_segments#

vak.prep.sequence_dataset.has_unlabeled_segments(dataset_df: DataFrame) bool[source]#

Returns True if a dataset annotated as sequences has segments that are unlabeled in any of the sequences.

Used to decide whether an additional class needs to be added to the set of labels \(Y = {y_1, y_2, \dots, y_n}\), where the added class \(y_{n+1}\) will represent the unlabeled “background” periods.

Parameters:

dataset_df (pandas.DataFrame) – A dataframe representing a source dataset of audio signals or spectrograms, as returned by vak.prep.audio_dataset.prep_audio_dataset() or vak.prep.spectrogram_dataset.prep_spectrogram_dataset().

Returns:

has_unlabeled – If True, there are annotations in the dataset that have unlabeled periods.

Return type:

bool