This content refers to an unreleased development version of PyMVPA
To provide the most recent news and documentation www.pymvpa.org reflects the
development 0.6 series of PyMVPA. If you are interested in the
documentation of the previous stable 0.4 series of PyMVPA, please
visit v04.pymvpa.org.
class mvpa.clfs.transerror.ConfusionMatrix(labels=None, labels_map=None, **kwargs)¶
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.
Initialize ConfusionMatrix with optional list of labels
Parameters :
labels : list
Optional set of labels to include in the matrix
labels_map : None or dict
Dictionary from original dataset to show mapping into
numerical labels
Optionally provided labels guarantee the order of
presentation. Also value of None places empty column/row,
thus provides visual groupping of labels (Thanks Ingo)
numbers : bool
Place values inside of confusion matrix elements
numbers_alpha : None or float
Controls textual output of numbers. If None – all numbers
are plotted in the same intensity. If some float – it controls
alpha level – higher value would give higher contrast. (good
value is 2)
origin : str
Which left corner diagonal should start
xlabels_vertical : bool
Either to plot xlabels vertical (benefitial if number of labels
is large)
numbers_kwargs : dict
Additional keyword parameters to be added to numbers (if numbers
is True)