Compute a confusion matrix from predictions and targets (Node interface)
This class is very similar to ConfusionMatrix and ConfusionMatrixError. However, in contrast to these this class can be used in any place that accepts Nodes – most importantly others node’s postproc functionality. This makes it very straightforward to compute confusion matrices from classifier output as an intermediate result and continue processing with other nodes. A sketch of a cross-validation setup using this functionality looks like this:
CrossValidation(some_classifier,
some_partitioner,
errorfx=None,
postproc=Confusion())
It is vital to set errorfx to None to preserve raw classifier prediction values in the output dataset to allow for proper data aggregation in a confusion matrix.
Notes
Available conditional attributes:
(Conditional attributes enabled by default suffixed with +)
Methods
generate(ds) | Yield processing results. |
get_postproc() | Returns the post-processing node or None. |
get_space() | Query the processing space name of this node. |
reset() | |
set_postproc(node) | Assigns a post-processing node |
set_space(name) | Set the processing space name of this node. |
Parameters : | attr : str
labels : list or None
add_confusion_obj : bool
enable_ca : None or list of str
disable_ca : None or list of str
space : str, optional
pass_attr : str, list of str|tuple, optional
postproc : Node instance, optional
descr : str
|
---|
Methods
generate(ds) | Yield processing results. |
get_postproc() | Returns the post-processing node or None. |
get_space() | Query the processing space name of this node. |
reset() | |
set_postproc(node) | Assigns a post-processing node |
set_space(name) | Set the processing space name of this node. |