Package mvpa :: Package clfs :: Module transerror :: Class SummaryStatistics

[hide private]
[frames] | no frames]

# Class SummaryStatistics

source code

Basic class to collect targets/predictions and report summary statistics

It takes care about collecting the sets, which are just tuples (targets, predictions, values). While 'computing' the matrix, all sets are considered together. Children of the class are responsible for computation and display.

Instance Methods | [hide private]

__init__(self, targets=None, predictions=None, values=None, sets=None) Initialize SummaryStatistics | source code

add(self, targets, predictions, values=None) Add new results to the set of known results | source code

asstring(self, short=False, header=True, summary=True, description=False) 'Pretty print' the matrix | source code

__str__(self) String summary over the SummaryStatistics | source code

__iadd__(self, other) Add the sets from `other` s SummaryStatistics to current one | source code

__add__(self, other) Add two `SummaryStatistics`s | source code

compute(self) Actually compute the confusion matrix based on all the sets | source code

_compute(self) Compute basic statistics | source code

summaries(self) Return a list of separate summaries per each stored set | source code

error(self) | source code

stats(self) | source code

reset(self) Cleans summary -- all data/sets are wiped out | source code

Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Class Variables | [hide private]

| _STATS_DESCRIPTION = `'# of sets', 'number of target/prediction`...``
| sets = `property(lambda self: self.__sets)`

Instance Variables | [hide private]

| _computed Flag either it was computed for a given set of data
| __sets Datasets (target, prediction) to compute confusion matrix on
| _stats Dictionary to keep statistics. Initialized here to please pylint

Properties | [hide private]

Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, targets=None, predictions=None, values=None, sets=None)
(Constructor)

source code

Initialize SummaryStatistics

targets or predictions cannot be provided alone (ie targets without predictions)

Parameters:
  - `targets` - Optional set of targets
  - `predictions` - Optional set of predictions
  - `values` - Optional set of values (which served for prediction)
  - `sets` - Optional list of sets
Overrides: object.__init__

### asstring(self, short=False, header=True, summary=True, description=False)

source code

'Pretty print' the matrix

Parameters:
  - `short` (bool) - if True, ignores the rest of the parameters and provides consise 1 line summary
  - `header` (bool) - print header of the table
  - `summary` (bool) - print summary (accuracy)
  - `description` (bool) - print verbose description of presented statistics

### __str__(self)
(Informal representation operator)

source code

String summary over the SummaryStatistics

It would print description of the summary statistics if 'CM' debug target is active

Overrides: object.__str__

### summaries(self)

source code

Return a list of separate summaries per each stored set

Decorators:
  - `@property`

### error(self)

source code

Decorators:
  - `@property`

### stats(self)

source code

Decorators:
  - `@property`

Class Variable Details | [hide private]

### _STATS_DESCRIPTION

Value:

      '# of sets', 'number of target/prediction sets which were provided', N
      one,