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

The model always predicts the same label #39

Closed
flaviomerenda opened this issue Jun 11, 2018 · 1 comment
Closed

The model always predicts the same label #39

flaviomerenda opened this issue Jun 11, 2018 · 1 comment

Comments

@flaviomerenda
Copy link

flaviomerenda commented Jun 11, 2018

Update:

I think that I solved the problem changing "argmax" with a threshold:

y_proba = model.predict(x_test)
Y_classes = (y_proba > 0.5).astype(np.int)
print(Y_classes)

Is it right?


Hi,

I run your code with another dataset in order to train this model for a binary classification task; It works fine, but when I print the predictions, it always assigns the same label (0 - absent) to whole instances.

This is the code used:

y_proba = model.predict(x_test)
Y_classes = y_proba.argmax(axis=-1)

Can you understand why? I'm quite new to deep learning and CNN

@flaviomerenda flaviomerenda changed the title The model always predict the same label The model always predicts the same label Jun 11, 2018
@alexander-rakhlin
Copy link
Owner

Hi,
Y_classes = (y_proba > 0.5).astype(np.int) should be correct.

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

2 participants