Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion libact/labelers/ideal_labeler.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ def __init__(self, dataset, **kwargs):
self.y = y

def label(self, feature):
return self.y[np.where([np.array_equal(x, feature) for x in self.X])[0]]
if np.count_nonzero([np.array_equal(x, feature) for x in self.X])==0
raise ValueError("No matching sample found in the dataset.")
return self.y[np.where([np.array_equal(x, feature) for x in self.X])]