I am doing sentimental analysis and using keras to predict positive/negative of movie reviews. What I want to know is the raw data, those are wrongly predicted by my model. I only can get the accuracy, loss from my model but I want to get the subset of texts in which my model predicted wrong. How to do it?
import pandas as pd
from keras.preprocessing.text import Tokenizer
from keras.layers import Dense
import keras
import numpy as np
import gc
from sklearn.model_selection import train_test_split
dataset=pd.read_csv('balanced_dataset.csv')
tk=Tokenizer(num_words=2000)
tk.fit_on_texts(dataset.review)
x=tk.texts_to_matrix(dataset.review)
y=dataset.label
x_train,x_test,y_train,y_test=train_test_split(x,y,test_size=0.3,random_state=40)
model=keras.models.Sequential()
model.add(Dense(8,input_dim=2000))
model.add(Dense(1,activation='sigmoid'))
model.compile(loss='binary_crossentropy',optimizer='rmsprop',metrics=['acc'])
del tk
gc.collect()
result=model.fit(x_train,y_train,batch_size=128,epochs=20,validation_split=0.1)