ntucllab / libact

Pool-based active learning in Python
http://libact.readthedocs.org/
BSD 2-Clause "Simplified" License
776 stars 174 forks source link

MMC gets error when the first example in dataset is unlabeled #136

Closed yangarbiter closed 6 years ago

yangarbiter commented 6 years ago

https://github.com/ntucllab/libact/blob/4cc56852ea6ff67de5e3634faa0a70770eb231b7/libact/query_strategies/multilabel/maximum_margin_reduction.py#L70

self.n_labels = len(self.dataset.data[0][1])

should be changed to

self.n_labels = len(self.dataset.get_labeled_entries()[0][1])