[pymvpa] Error when using pearsonr with ridgeregression
Yaroslav Halchenko
debian at onerussian.com
Thu Jan 15 14:23:33 UTC 2015
Hi Thomas,
On Thu, 15 Jan 2015, Thomas Nickson wrote:
> /home/orkney_01/tnickson/Programming/pyVirtualEnv/lib/python2.6/site-packages/mvpa2/base/dataset.pyc in __init__(self, samples, sa, fa, a)
> 213 if not hasattr(samples, 'dtype'):
> 214 raise ValueError(
> --> 215 "AttrDataset only supports dtypes as samples that have a "
> 216 "`dtype` attribute that behaves similar to the one of an "
> 217 "array-like.")
> ValueError: AttrDataset only supports dtypes as samples that have a `dtype` attribute that behaves similar to the one of an array-like.
good way to troubleshoot such troubles when working in ipython, is to
enable pdb (just type %pdb) so it would fall into debugger right at that
point. Then you could inspect
(Pdb) print samples
(0.26726124191242479, 0.010880186798833041)
to get a hint that pearsonr returns a tuple of both correlation and p value.
It still smells like a bug in PyMVPA that we don't wrap it up properly but as
an overcome you would just need to choose which one to use, e.g.
errorfx=lambda x,y: pearsonr(x,y)[0],
But then let's get back altogether to your analysis -- you are using a
classifier, so dealing with classes and then using correlation coefficient as a
measure (for ordered data) -- doesn't sound quite right unless there is some
agenda behind your dataset's targets ;)
--
Yaroslav O. Halchenko, Ph.D.
http://neuro.debian.net http://www.pymvpa.org http://www.fail2ban.org
Research Scientist, Psychological and Brain Sciences Dept.
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
Phone: +1 (603) 646-9834 Fax: +1 (603) 646-1419
WWW: http://www.linkedin.com/in/yarik
More information about the Pkg-ExpPsy-PyMVPA
mailing list