From the course: Text Analytics and Predictions with Python Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Predictions for text

Predictions for text - Python Tutorial

From the course: Text Analytics and Predictions with Python Essential Training

Start my 1-month free trial

Predictions for text

- [Instructor] In this video, we will predict the class of the course description based on the classifier we have built. First, we will predict for the test dataset we created in the previous video. We create the predictions with the predict function. Then we print the Confusion Matrix for the prediction using the matrix class in scikit-learn. We also print the Prediction Accuracy. Let us run this code now. Looking at the numbers, we see that the prediction accuracy is low. This is because we only used a small amount of sample set with 20 documents. If we had a much bigger corpus, our accuracy levels may improve. As a second try, we try to predict for the entire corpus and then print the results. The accuracy levels go up to 90% but then we are predicting for the data we originally used to build the model so it'll be high. In real-world scenarios, we need to experiment which much bigger datasets and different algorithms to build an accurate classifier.

Contents