Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

predict_proba generating predictions > number of classes #24

Open
Blair-Young opened this issue Dec 16, 2016 · 1 comment
Open

predict_proba generating predictions > number of classes #24

Blair-Young opened this issue Dec 16, 2016 · 1 comment
Assignees

Comments

@Blair-Young
Copy link

I'm training my classifier using
clf = RVC(kernel = 'rbf')
clf.fit(embeddings, labelsNum)
were the number of labels = 10

When I inspect the clf I get this:
with open('RVC.pkl', 'r') as rvc:
le_rvc, clf_rvc = pickle.load(rvc)

array(['Ariel_Sharon', 'Colin_Powell', 'Donald_Rumsfeld', 'George_W_Bush',
       'Gerhard_Schroeder', 'Hugo_Chavez', 'Jean_Chretien',
       'John_Ashcroft', 'Junichiro_Koizumi', 'Tony_Blair'], 
      dtype='|S17')

Which is correct, 10 classes.

However, when I try to predict my test set by running this

predictions = clf.predict_proba(rep).ravel()
                maxI = np.argmax(predictions)
                person = le.inverse_transform(maxI)
                confidence = predictions[maxI]

the length of predictions is 20

Meaning that when
le.inverse_transform(maxI)
is called it fails if maxl is >10

I must be doing something wrong on my side, but is there a reason why the clf is predicting more values than needed?

@Blair-Young
Copy link
Author

Hey, just wondering how this bug fix is going?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants