[pymvpa] SL on an artificial dataset

Michael Hanke mih at debian.org
Tue Apr 3 08:39:26 UTC 2012


On Tue, Apr 03, 2012 at 10:22:28AM +0200, Matthias Ekman wrote:
> Thanks Michael,
> I guess I am missing something very obvious here. With the following
> code I get the error below (it doesn't seem to be related to
> 'mycoord').

Yes, the way you work with datasets changed a bit from 0.4 to 2.0.
Essentially you are missing the 'chunks' aattribute:

> ds = Dataset(X)
> ds.targets = y
> ds.chunks = np.arange(50)

This DOES NOT create a samples attribute in the dataset. You are just
sticking this array into the dataset object. Do a 'print ds' to see what
is going on.

The right way(TM) to add this attribute is:

	>>> ds.sa['chunks'] = np.arrange(50)

Alternatively, you can use a helper to combine all of the above:

	>>> ds = dataset_wizard(X, targets=y, chunks=np.arrange(50)

Does that work for you?

Here is a bit more info on the new dataset:




Dr. Michael Hanke
Abteilung für Allgemeine Psychologie,    Institut für  Psychologie II
Otto-von-Guericke-Universität Magdeburg,  Universitätsplatz 2, Geb.24
Tel.: +49(0)391-67-18481 Fax: +49(0)391-67-11947  GPG: 4096R/7FFB9E9B

More information about the Pkg-ExpPsy-PyMVPA mailing list