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.17.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