Hello,
I'm trying to run my first classification analysis on my own data, and
every classification type seems to work except LinearCSVMC(). I'm attaching
my python file of code and I've pasted the error I get at the bottom of it.
Any help on why this is happening would be great!
Thank you,
Jessica
from mvpa2.suite import *
import numpy as np
import scipy.stats as sp
import scipy.io
import nibabel
import random
path = '/home/menglab/JG/AP/concat/Session 1'
attr = SampleAttributes(os.path.join(path, 'attributes.txt'))
fds = fmri_dataset(samples=os.path.join(path, 'ap_all.nii'), targets = attr.targets, chunks=attr.chunks, mask = os.path.join(path, 'rFFA_AP1.nii'))
detrender = PolyDetrendMapper(polyord=1, chunks_attr='chunks')
detrended_fds = fds.get_mapped(detrender)
#zscore(detrended_fds, param_est=('targets', ['none']))
fds = detrended_fds
##problem could be with z-scoring!
fds = fds[fds.sa.targets != 'none']
rnames = {'A': 'Face', 'B': 'High_Face', 'C': 'Low_Face', 'D': 'Non_Face'}
fds.sa['runtype'] = [rnames in fds.sa.chunks]
clf = LinearCSVMC()
cvte = CrossValidation(clf, HalfPartitioner(attr='runtype'))
cv_results = cvte(fds)
#Traceback (most recent call last):
# File "<stdin>", line 1, in <module>
#File "/usr/lib/pymodules/python2.7/mvpa2/base/learner.py", line 237, in __call__
# return super(Learner, self).__call__(ds)
# File "/usr/lib/pymodules/python2.7/mvpa2/base/node.py", line 76, in __call__
# result = self._call(ds)
# File "/usr/lib/pymodules/python2.7/mvpa2/measures/base.py", line 472, in _call
# return super(CrossValidation, self)._call(ds)
# File "/usr/lib/pymodules/python2.7/mvpa2/measures/base.py", line 305, in _call
# result = node(sds)
# File "/usr/lib/pymodules/python2.7/mvpa2/base/learner.py", line 237, in __call__
# return super(Learner, self).__call__(ds)
# File "/usr/lib/pymodules/python2.7/mvpa2/base/node.py", line 76, in __call__
# result = self._call(ds)
# File "/usr/lib/pymodules/python2.7/mvpa2/measures/base.py", line 560, in _call
# measure.train(dstrain)
# File "/usr/lib/pymodules/python2.7/mvpa2/base/learner.py", line 121, in train
#result = self._train(ds)
# File "/usr/lib/pymodules/python2.7/mvpa2/clfs/libsvmc/svm.py", line 186, in _train
# raise FailedToTrainError(str(e))
#mvpa2.base.learner.FailedToTrainError: in method 'svm_parameter_C_set', argument # 2 of type 'double'
_______________________________________________
Pkg-ExpPsy-PyMVPA mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa