Class to contain information and display confusion matrix.
Implementation of the SummaryStatistics in the case of classification problem. Actual computation of confusion matrix is delayed until all data is acquired (to figure out complete set of labels). If testing data doesn’t have a complete set of labels, but you like to include all labels, provide them as a parameter to the constructor.
Confusion matrix provides a set of performance statistics (use as_string(description=True) for the description of abbreviations), as well ROC curve (http://en.wikipedia.org/wiki/ROC_curve) plotting and analysis (AUC) in the limited set of problems: binary, multiclass 1-vs-all.
Methods
add(targets, predictions[, estimates]) | Add new results to the set of known results |
as_string([short, header, summary, description]) | ‘Pretty print’ the matrix |
compute() | Actually compute the confusion matrix based on all the sets |
get_labels_map() | |
plot([labels, numbers, origin, ...]) | Provide presentation of confusion matrix in image :Parameters: labels : list of int or str Optionally provided labels guarantee the order of presentation. |
reset() | Cleans summary – all data/sets are wiped out |
set_labels_map(val) |
Initialize ConfusionMatrix with optional list of labels
Parameters: | labels : list
labels_map : None or dict
targets :
predictions :
|
---|
Methods
add(targets, predictions[, estimates]) | Add new results to the set of known results |
as_string([short, header, summary, description]) | ‘Pretty print’ the matrix |
compute() | Actually compute the confusion matrix based on all the sets |
get_labels_map() | |
plot([labels, numbers, origin, ...]) | Provide presentation of confusion matrix in image :Parameters: labels : list of int or str Optionally provided labels guarantee the order of presentation. |
reset() | Cleans summary – all data/sets are wiped out |
set_labels_map(val) |
‘Pretty print’ the matrix
Parameters: | short : bool
header : bool
summary : bool
description : bool
|
---|
Return a list of separate confusion matrix per each stored set
Provide presentation of confusion matrix in image
Parameters: | labels : list of int or str
numbers : bool
numbers_alpha : None or float
origin : str
xlabels_vertical : bool
numbers_kwargs : dict
**kwargs :
|
---|---|
Returns: | (fig, im, cb) – figure, imshow, colorbar : |