I have been given a set of testing data which was classified by 3 people whether it was true or false. I also was given the confidence - for example sometimes 2/3 agreed in one direction. How can I incorporate this into my classifier models. I have looked into SGDClassifier which has the class_weight
param and so does SVM. I am then iterating each of the confidence levels and for each row of data assigning the weight of 3 or 2 depending on whether all three were classified the same or not:
x=0
weights = {}
for d in confidence:
val = int(d[1])
if(val == 1):
weight = 3
else: # d=0.66
weight = 2
x = x+1
weights[x] = weight
Unfortunately then, when running:
SGDClassifier(class_weight=weights)
I get the error:
Class label 2 not present.
What am I doing wrong?