Enrollments Open for Online Instructor-Led Training for Big Data Engineering and Machine Learning | Use Coupon END15 for Extra 15% Off

  Enroll Now

Evaluating the Model Performance

Let us see how well our model has learnt from the train data, by testing it on the test data.

INSTRUCTIONS
  • Use model..evaluate on X_test, y_test to see the test data prediction accuracy:

    model.evaluate(X_test, y_test)
    
  • Let us predict and visualize the first 3 samples from the test data.

    y_pred = model.predict_classes(X_test[:3])
    print(y_pred)
    print([class_names[index] for index in y_pred])
    
  • Visualize the predictions for the first 3 samples from the test data:

    plt.figure(figsize=(7, 3))
    
    for index, image in enumerate(X_test[:3]):
        plt.subplot(1, 3, index + 1)
        plt.imshow(image, cmap="binary")
        plt.axis('off')
        plt.title(class_names[y_pred[index]], fontsize=12)
    plt.subplots_adjust(wspace=0.2, hspace=0.5)
    
    plt.show()
    

No hints are availble for this assesment

Answer is not availble for this assesment


Note - Having trouble with the assessment engine? Follow the steps listed here

Loading comments...