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

Retrieve probabilities? #4

Open
tommedema opened this issue Jul 31, 2018 · 2 comments
Open

Retrieve probabilities? #4

tommedema opened this issue Jul 31, 2018 · 2 comments

Comments

@tommedema
Copy link

I believe that the predictions are actually "rounded" results, is that right? I.e. a logistic regression is capable of returning a probability for a classification, rather than just the most likely classification.

I would like to receive e.g. 0.6 instead of 1 and 0.3 instead of 0. Is this possible?

@xug15
Copy link

xug15 commented May 25, 2019

Yes, How can we find them?

@hansmaad
Copy link

I think you can use testScores on the classifiers. In a 2 classes model:

const finalResults = logreg.predict(Xtest);
const score0 = logreg.classifiers[0].testScores(Xtest);
const score1 = logreg.classifiers[1].testScores(Xtest);

This is used by predict to find the index of the classifier with the minimum score.

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

No branches or pull requests

3 participants