NameError: name 'X_val_prep' is not defined

Author: Aisha5Created Jul 15, 2020Updated Jul 15, 2020

Hello I have written the following code:

validate on val set predictions = model.predict(X_val_prep) predictions = [1 if x>0.5 else 0 for x in predictions]

accuracy = accuracy_score(y_val, predictions) print('Val Accuracy = %.2f' % accuracy)

confusion_mtx = confusion_matrix(y_val, predictions) cm = plot_confusion_matrix(confusion_mtx, classes = list(labels.items()), normalize=False)

NameError: name 'X_val_prep' is not defined

Could you help me how I should tackle it? thank u very much.

Source: fchollet/deep-learning-models