Question: 5.0.5 2e) Prediction Predict the labels for both the training and test samples (the 'X' data). You will need to use MR_tfidf_clf . predict (...)

5.0.5 2e) Prediction Predict the labels for both
5.0.5 2e) Prediction Predict the labels for both the training and test samples (the 'X' data). You will need to use MR_tfidf_clf . predict (...) Name the predicted labels on training samples as MR_pred_train_tfidf_Y. Name the predicted labels on testing samples as MR_pred_test_tfidf_Y Note: this may take a few seconds to run. # your code here raise NotImplementedError Again, we use classification_report to check the performance on the training set. : # Your classifier should be able to reach above 86% accuracy. print (classification_report (MR_train_tfidf_Y, MR_pred_train_tfidf_Y)) Again, check performance on the test set: : # Your classifier should be able to reach around 71% accuracy. print (classification_report (MR_test_tfidf_Y, MR_pred_test_tfidf_Y) ) precision, recall, _, _ = precision_recall_fscore_support (MR_train_tfidf_Y, MR_pred_train_tfidf_Y) assert np . isclose (precision [0] , 0. 85, 0.02) assert np . isclose (precision [1] , 0. 89, 0.02)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!