[pymvpa] MVPA .4 and multi-feature RBF

Ray Schumacher subscriber100 at rjs.org
Fri Dec 16 02:46:27 UTC 2011


OK, doing better now:

'gcc' is not recognized as an internal or external command,
operable program or batch file.
Warning: Extremely bad integrand behavior occurs at some points of the
   integration interval.
Warning: Extremely bad integrand behavior occurs at some points of the
   integration interval.
C:\Python27\lib\site-packages\numpy\lib\function_base.py:1881: 
RuntimeWarning: i
nvalid value encountered in _cdf_single_call (vectorized)
   _res = array(self.ufunc(*newargs),copy=False,
data shape (29, 48)
[[  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,   0.00000000e+00
     0.00000000e+00   0.00000000e+00]
  [  4.25000000e+00   2.00000000e+00   3.28095198e+00 ...,   3.36161407e+02
     4.00000000e+00   1.88758421e+00]
  [  2.25000000e+00   1.25000000e+00   1.29995737e+01 ...,  -1.12926743e+02
     4.00000000e+00   1.54000878e+00]
  ...,
  [  2.75000000e+00   1.75000000e+00   1.64393539e+01 ...,  -2.03354130e+01
     4.00000000e+00   1.86474490e+00]
  [  2.50000000e+00   1.25000000e+00   1.31833363e+01 ...,   3.83047516e+02
     3.00000000e+00   1.81208789e+00]
  [  7.50000000e-01   5.00000000e-01   9.99900000e+03 ...,  -2.68942773e+03
     4.00000000e+00   1.32900274e+00]] 48
0.275862068966

Code:
import numpy
import mvpa
from mvpa.datasets.masked import MaskedDataset
from mvpa.clfs.svm import RbfCSVMC

fh = open('con4.csv', 'r')
lines = fh.readlines()
fh.close()
features = lines[0].split(',')[1:]

labels = numpy.zeros((len(lines)-1), dtype=numpy.float32)

data = numpy.zeros((len(lines)-1, len(features)-1), dtype=numpy.float32)
print 'data shape', data.shape
for smp in range(1,len(lines)-1):
     d = lines[smp].split(',')[1:]
     labels[smp] = d[1]
     data[smp, :] = lines[smp].split(',')[2:]

ds = mvpa.datasets.Dataset(samples=data, labels=labels, chunks=1, 
labels_map=True)
print data, ds.nfeatures

clf = RbfCSVMC(probability=1,  enable_states=['probabilities'])
clf.train(ds)
print numpy.mean(clf.predict(ds.samples) == ds.labels)

I see in
http://lists.alioth.debian.org/pipermail/pkg-exppsy-pymvpa/2009q2/000495.html
that parameter selection is not generated/optimized; so what SVM 
should I test to auto generate optimized classifier(s)?



Ray Schumacher
Programmer/Consultant  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-exppsy-pymvpa/attachments/20111215/01136079/attachment.html>


More information about the Pkg-ExpPsy-PyMVPA mailing list