NUAA-AL / ALiPy

ALiPy: Active Learning in Python is an active learning python toolbox, which allows users to conveniently evaluate, compare and analyze the performance of active learning methods.

Home Page:http://parnec.nuaa.edu.cn/huangsj/alipy/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problems with select_by_prediction_mat function of class QueryInstanceUncertainty

JuliaMasche opened this issue · comments

Hi,

I try to do instance selection with the select_by_prediction_mat function. My predict 2D-Array looks like this:

[['1' '0.5258755683898926']
['2' '0.5193215012550354']
['1' '0.557829737663269']
...
['1' '0.550930380821228']
['1' '0.5237742066383362']
['1' '0.5445562601089478']]

If I use this as my predict input for the function with entropy as measure, I get the following error:
Traceback (most recent call last):
File "test_flair.py", line 174, in
select_ind = Uncertaint_Strategy.select_by_prediction_mat(unlab_ind, pred_ma, batch_size=5)
File "/home/julia/master_thesis/env/lib/python3.6/site-packages/alipy/query_strategy/query_labels.py", line 215, in select_by_prediction_mat
pv[pv <= 0] = 1e-06 # avoid zero division
TypeError: '<=' not supported between instances of 'numpy.ndarray' and 'int'

Could you tell me in detail how the predict matrix should look like? I know it says [n_samples, n_classes], but I have problems to understand exactly what that means. Could you tell me for my predict matrix how I should transform it so it will work?

thank you in advance