![]() |
Multivariate Pattern Analysis in Python |
There are 3 types of messages PyMVPA can produce:
By default, all types of messages are printed by PyMVPA to the standard output. It is possible to redirect them to standard error, or a file, or a list of multiple such targets, by using environment variable MVPA_?_OUTPUT, where X is either VERBOSE, DEBUG, or WARNING correspondingly. E.g.:
export MVPA_VERBOSE_OUTPUT=stdout,/tmp/1 MVPA_WARNING_OUTPUT=/tmp/3 MVPA_DEBUG_OUTPUT=stderr,/tmp/2
would direct verbose messages to standard output as well as to /tmp/1 file, warnings will be stored only in /tmp/3, and debug output would appear on standard error output, as well as in the file /tmp/2.
PyMVPA output redirection though has no effect on external libraries debug output if corresponding debug target is enabled
Primarily for a user of PyMVPA to provide information about the progress of their scripts. Such messages are printed out if their level specified as the first parameter to verbose function call is less than specified. There are two easy ways to specify verbosity level:
The following verbosity levels are supported:
0: nothing besides errors 1: high level stuff – top level operation or file operations 2: cmdline handling 3: n.a. 4: computation/algorithm relevant thing
Reported by PyMVPA if something goes a little unexpected but not critical. By default they are printed just once per occasion, i.e. once per piece of code where it is called. Following environment variables control the behavior of warnings:
In python code, invocation of warning with argument bt = True enforces printout of traceback whenever warning tracebacks are disabled by default.
Debug messages are used to track progress of any computation inside PyMVPA while the code run by python without optimization (i.e. without -O switch to python). They are specified not by the level but by some id usually specific for a particular PyMVPA routine. For example RFEC id causes debugging information about Recursive Feature Elimination call to be printed (See misc module sources for the list of all ids, or print debug.registered property).
Analogous to verbosity level there are two easy ways to specify set of ids to be enabled (reported):
Besides printing debug messages, it is also possible to print some metric. You can define new metrics or select predefined ones (vmem, asctime, pid). To enable list of metrics you can use MVPA_DEBUG_METRICS environment variable to list desired metric names comma-separated.
As it was mentioned earlier, debug messages are printed only in non-optimized python invocation. That was done to eliminate any slowdown introduced by such ‘debugging’ output, which might appear at some computational bottleneck places in the code.
Some of the debug ids are defined to facilitate additional checking of the validity of the analysis. E.g. RETRAIN id would cause additional checking of the data in retraining phase. Such additional testing might spot out some bugs in the internal logic.
To facilitate reproducible troubleshooting, a seed value of random generator of NumPy can be provided in debug mode (python is called without -O) via environment variable MVPA_SEED=<int>. Otherwise it gets seeded with random integer which can be displayed with debug id RANDOM e.g.:
> MVPA_SEED=123 MVPA_DEBUG=RANDOM python test_clf.py [RANDOM] DBG: Seeding RNG with 123 ... > MVPA_DEBUG=RANDOM python test_clf.py [RANDOM] DBG: Seeding RNG with 1447286079 ...
(to be written)
(to be written)