Error on small data
kliegr opened this issue · comments
Assume the following small test case
y_true=[False,True,True,True,False,False,False]
y_pred_prob=[0.6,0.7,0.4,0.3,0.2,0.15,0.1]
PR_plot, area_under_PR = bc.curve_PR_plot(true_y = y_true,
predicted_proba = y_pred_prob,
beta = 1)
The package will fail at
--> 676 baseline = len(true_y[true_y==1]) / len(true_y)
TypeError: object of type 'bool' has no len()
The reason seems to be that after the subsetting, the list degenerated to a single item and ceased to be list.
Hi, thanks for reporting this.
The bug was fixed in version 1.1.0.