Project - How to Build a Sentiment Classifier using Python and IMDB Reviews

11 / 11

Training and Testing the Model

  • It's time for training the model on the train data.

  • Let us also measure the time of training using time module.

  • Finally, let us test the model performance on the test data.

INSTRUCTIONS
  • Import time.

    import << your code comes here >>
    
  • Store the start time using time.time() in start.

    start = << your code comes here >>
    
  • Fit the model for the train_set.

    model.fit(train_set, steps_per_epoch=train_size // 32, epochs=2)
    
  • Store the end time using time.time() in end.

    end = << your code comes here >>
    
  • Print the time of execution using (end-start).

    print("Time of execution:", end-start)
    
  • Use model.evaluate to test the model performance on the test_set.

    model.evaluate(test_set)
    
Get Hint See Answer


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

Loading comments...