I am doing a simple binary text classification. The steps go roughly like this:
- preprocess training data with CountVectorizer()
- build a keras Sequential() model
- model.fit(x_train, y_train)
- model.evaluate(x_val, y_val)
- model.predict(x_test)
I am stuck on step 5 - when I print the predicted values, I get a numpy array of:
[0.9434484 ]
[0.3787447 ]
...
[0.87870705]
[0.7575223 ]
[0.39714795]]
Since I am doing a binary classification, and my labels are 0 and 1, I expected the prediction output to be the same? Now it seems like it predicts the probability between the labels 0 and 1, which is not what I wanted. Do I need to encode the prediction output somehow so that it returns the proper labels or have I done something wrong in the steps before??