Flash Sale: Flat 70% + Addl. 25% Off on all Courses | Use Coupon DS25 in Checkout | Offer Expires In

  Enroll Now

Cat vs Non-cat Classifier - Evaluating the model on Test Data

The parameter values for the best model are returned in the form of a dictionary best_values by calling model function.

The train and validation accuracies seem reasonable enough, leaving the impression of just fit, but not overfit or underfit model.

Let us evaluate this implication by getting the predictions for our test set and calculating the test set accuracies.

INSTRUCTIONS
  • Call the predict function and pass the final weight and bias matrices stored in best_values, along with the test set.

    Y_prediction_test = << your code comes here >>(best_values['final w'], best_values['final b'], test_set_x)
    
  • Now, let us calculate the accuracy of the model on the test set. Call the get_accuracies function.

    test_acc = << your code comes here >>(test_set_y, Y_prediction_test)
    print("Test accuracy is: ",test_acc)
    
  • Print the final best parameters as follows:

    print("Final best model:")
    print("For Learning rate:" ,best_values['final_lr'], ", Epoch - ",best_values['epoch'])
    print("Train accuracy: ", best_values['Train accuracy'])
    print("Validation accuracy: ",best_values['Validation accuracy'])
    print("Test accuracy is: ",test_acc)
    

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