I have run your code you have implemented naive_bayes.GaussianNB estimator resulted with 0.6 accuracy. It is a suitable estimator for text data. However, since you converted the text values in to a numeric form you can use other estimators such as LogisticRegression or Linear SVM for a better accuracy. I have added LogesticRegression model to your code with out any other modification and I have got around 0.79 accuracy.
In addition, you can improve the accuracy by:
- Removing nan and null values from the dataset.
- For feature extraction, use only
headline, category and article as your data as the rest of the columns are not necessary.
I have run your code you have implemented naive_bayes.GaussianNB estimator resulted with
0.6accuracy. It is a suitable estimator for text data. However, since you converted the text values in to a numeric form you can use other estimators such as LogisticRegression or Linear SVM for a better accuracy. I have added LogesticRegression model to your code with out any other modification and I have got around0.79accuracy.In addition, you can improve the accuracy by:
headline,categoryandarticleas your data as the rest of the columns are not necessary.