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
def to_table(report):
report = report.splitlines()
res = []
res.append(['']+report[0].split())
for row in report[2:-2]:
res.append(row.split())
lr = report[-1].split()
res.append([' '.join(lr[:3])]+lr[3:])
return np.array(res)
returns a numpy array which can be turned to pandas dataframe or just be saved as csv file.