[pymvpa] New Elastic Net classifier
patrik andersson
andersson.j.p at gmail.com
Thu Aug 13 18:40:28 UTC 2009
Hi,
I am trying to get the ENET working but get some error. I guess its a
rpy problem (?), but thought I'll take a chance and reply to this
thread.
Code snippet:
clf = FeatureSelectionClassifier(
ENET(lm=1.0,trace=False,normalize=False),
SensitivityBasedFeatureSelection(
OneWayAnova(),
FractionTailSelector(0.05,mode='select',tail='upper')),
descr="apa",
enable_states = ['feature_ids'])
terr = TransferError(clf)
cvterr = CrossValidatedTransferError(terr,
NFoldSplitter(cvtype=5),
enable_states=['confusion','harvested'])
error = cvterr(ds)
gives:
Traceback (most recent call last):
File "C:\Project\PatternAnalysis\PyMVPA\EgnaScripts\test2.py", line
92, in <module>
error = cvterr(ds)
File "C:\Python25\Lib\site-packages\mvpa\measures\base.py", line
105, in __call__
result = self._call(dataset)
File "C:\Python25\Lib\site-packages\mvpa\algorithms\cvtranserror.py",
line 173, in _call
result = transerror(split[1], split[0])
File "C:\Python25\Lib\site-packages\mvpa\clfs\transerror.py", line
1283, in __call__
self._precall(testdataset, trainingdataset)
File "C:\Python25\Lib\site-packages\mvpa\clfs\transerror.py", line
1239, in _precall
self.__clf.train(trainingdataset)
File "C:\Python25\Lib\site-packages\mvpa\clfs\base.py", line 354, in train
result = self._train(dataset)
File "C:\Python25\Lib\site-packages\mvpa\clfs\meta.py", line 1083, in _train
self.__maskclf.clf.train(wdataset)
File "C:\Python25\Lib\site-packages\mvpa\clfs\base.py", line 354, in train
result = self._train(dataset)
File "C:\Python25\Lib\site-packages\mvpa\clfs\enet.py", line 133, in _train
trace=self.__trace)
TypeError: object of type 'numpy.float32' has no len()
Any help is very appreciated! (Hopefully some day I will be on the
other side of the Q&A ;) )
PS. I have Vista and R 2.6.2
Kind regards,
Patrik
More information about the Pkg-ExpPsy-PyMVPA
mailing list