This documentation is for scikit-learn version 0.11-gitOther versions

Citing

If you use the software, please consider citing scikit-learn.

This page

8.16.1.9. sklearn.metrics.classification_report

sklearn.metrics.classification_report(y_true, y_pred, labels=None, target_names=None)

Build a text report showing the main classification metrics

Parameters :

y_true : array, shape = [n_samples]

true targets

y_pred : array, shape = [n_samples]

estimated targets

labels : array, shape = [n_labels]

optional list of label indices to include in the report

target_names : list of strings

optional display names matching the labels (same order)

Returns :

report : string

Text summary of the precision, recall, f1-score for each class