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

How can i get prediction labels 0 or 1 for the test set. #827

Open
tramya28 opened this issue May 8, 2020 · 1 comment
Open

How can i get prediction labels 0 or 1 for the test set. #827

tramya28 opened this issue May 8, 2020 · 1 comment
Labels

Comments

@tramya28
Copy link

tramya28 commented May 8, 2020

I am using MatchZoo version 2. I have several models from match zoo working. When i use the prediction, i get a prediction score between 0 and 1. Is there a way i could get 0 or 1 for each row in my test set instead of probability score.
The current code i use is

pred_x, pred_y = test_processed.unpack()
result = model.predict(pred_x)
When i look at the result, i see an array of probability scores = [[0.6524335 0.34756643]
[0.27325273 0.72674733]
[0.2813605 0.71863943]
...
[0.4537154 0.54628456]
[0.2675834 0.7324166 ]
[0.4178532 0.58214676]]

Is there a way i could get 0s and 1s instead of the probability scores for each test row?

@faneshion
Copy link
Member

Typically, we can directly transform the score to labels through a pre-defined threshold, e.g., 0.5.

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

No branches or pull requests

2 participants