Registrations Closing Soon for DevOps Certification Training by CloudxLab | Registrations Closing in

  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.

  • 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([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.title(class_names[y_pred[index]], fontsize=12)
    plt.subplots_adjust(wspace=0.2, hspace=0.5)

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...