I\'m doing a multiclass text classification in Scikit-Learn. The dataset is being trained using the Multinomial Naive Bayes classifier having hundreds of labels. Here\'s an extr
The simplest and best way I found is:
classes = ['class 1','class 2','class 3'] report = classification_report(Y[test], Y_pred, target_names=classes) report_path = "report.txt" text_file = open(report_path, "w") n = text_file.write(report) text_file.close()