You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am running experiments for multi-class classification and get the following error for EpectedErrorReduction:
File "/home/julia/master_thesis/env/lib/python3.6/site-packages/alipy/query_strategy/query_labels.py", line 829, in select
score.append(pv[i, yi] * self.log_loss(prob))
IndexError: index 4 is out of bounds for axis 1 with size 4
I think the Error is that my initial seed set (label index) does not contain all labels which can be found in y.
In the following code, shouldn't it be
classes = np.unique(label_y)
instead of
classes = np.unique(self.y)?
`` if self.X is None or self.y is None:
raise Exception('Data matrix is not provided.')
if model is None:
model = LogisticRegression(solver='liblinear')
model.fit(self.X[label_index if isinstance(label_index, (list, np.ndarray)) else label_index.index],
self.y[label_index if isinstance(label_index, (list, np.ndarray)) else label_index.index])
Hi, the problem is exactly what you think. Note that most of the existing AL methods do not expect the examples in unseen classes, unless they are proposed for openset problems.
So, please re-split your dataset and ensure that each class contains at least one example. (Use the split function in alipy can achieve this goal :) )
Hi,
I am running experiments for multi-class classification and get the following error for EpectedErrorReduction:
File "/home/julia/master_thesis/env/lib/python3.6/site-packages/alipy/query_strategy/query_labels.py", line 829, in select
score.append(pv[i, yi] * self.log_loss(prob))
IndexError: index 4 is out of bounds for axis 1 with size 4
I think the Error is that my initial seed set (label index) does not contain all labels which can be found in y.
In the following code, shouldn't it be
classes = np.unique(label_y)
instead of
classes = np.unique(self.y)?
`` if self.X is None or self.y is None:
raise Exception('Data matrix is not provided.')
if model is None:
model = LogisticRegression(solver='liblinear')
model.fit(self.X[label_index if isinstance(label_index, (list, np.ndarray)) else label_index.index],
self.y[label_index if isinstance(label_index, (list, np.ndarray)) else label_index.index])
The text was updated successfully, but these errors were encountered: