[pymvpa] Trying to use Scikit-Learn PCA yields error
Thomas Nickson
thomas.nickson at gmail.com
Thu Dec 18 15:43:34 UTC 2014
Hello All,
I'm trying to use the scikit-learn implementation of PCA because the
pymvpa/mdp version seems to end in a meomory error.
All I'm doing is wrapping the scikit-learn pca in the SKLTransformer like
so:
SKPCA = SKLTransformer(PCA())
and then attempting:
newds = ds.get_mapped(SKPCA)
but I get the error:
---------------------------------------------------------------------------TypeError
Traceback (most recent call
last)<ipython-input-191-3fb69e6da8d4> in <module>() 60 zscore(ds,
chunks_attr=None) 61 ---> 62 newds = ds.get_mapped(SKPCA)
/home/orkney_01/tnickson/Programming/pyVirtualEnv/lib/python2.6/site-packages/mvpa2/datasets/base.pyc
in get_mapped(self, mapper) 52 # forward would lead to
different behavior 53 #mds = mapper(self)---> 54
mds = mapper.forward(self) 55 mds._append_mapper(mapper)
56 return mds
/home/orkney_01/tnickson/Programming/pyVirtualEnv/lib/python2.6/site-packages/mvpa2/mappers/base.pyc
in forward(self, data) 185 debug('MAP',
"Forward-map %s-shaped dataset through '%s'." 186
% (data.shape, self))--> 187 return
self._forward_dataset(data) 188 else: 189 if
hasattr(data, 'ndim') and data.ndim < 2:
/home/orkney_01/tnickson/Programming/pyVirtualEnv/lib/python2.6/site-packages/mvpa2/mappers/skl_adaptor.pyc
in _forward_dataset(self, ds) 89 self._set_trained()
90 else:---> 91 out = tf.transform(ds.samples,
self._get_y(ds)) 92 return out
TypeError: transform() takes exactly 2 arguments (3 given)
SKPCA.train(ds) works fine but forward does not and throws the same error.
Any thoughts?
Thanks,
TOm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-exppsy-pymvpa/attachments/20141218/ad7b5354/attachment.html>
More information about the Pkg-ExpPsy-PyMVPA
mailing list