<html>
<body>
<font color="#800000">I'm using .4.7 and Py27 (no .6 Win binary ?), from
<a href="http://www.lfd.uci.edu/~gohlke/pythonlibs/#pymvpa" eudora="autourl">
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pymvpa</a> actually...<br>
We have been using CART to develop dtrees, but I'd like to test basis
functions or SVMs.<br><br>
I'm trying to develop a classifier for a data set with 48 (possibly
useful) features, 29 data points, and one binary condition/model.<br>
I create a dataset, but now how do I set up SVM, or another classifier,
for my shape (29, 48) data? <br>
I'm sorry but the examples etc. have not gotten me there, yet.<br><br>
</font><font size=1>mvpa.misc.exceptions.DatasetError: Dataset handling
exception: Length of sample<br>
attribute 'labels' [48] has to match the number of samples [29].<br><br>
</font><font color="#800000">Code so far:<br><br>
</font><font size=1>import numpy<br>
import mvpa<br>
from mvpa.clfs.svm import RbfNuSVMC<br><br>
fh = open('con4.csv', 'r')<br>
lines = fh.readlines()<br>
fh.close()<br>
labels = lines[0].split(',')<br><br>
data = numpy.zeros((len(lines)-1, len(labels)-3),
dtype=numpy.float32)<br>
print 'data shape', data.shape ## (29, 48)<br>
for smp in range(1,len(lines)-1):<br>
data[smp, :] = lines[smp].split(',')[3:]<br><br>
ds = mvpa.datasets.Dataset(samples=data, labels=labels[3:], chunks=1,
labels_map=True)<br>
print data, ds.nfeatures<br><br>
clf = RbfNuSVMC(probability=1,
enable_states=['probabilities'])<br>
clf.train(ds)<br>
print numpy.mean(clf.predict(ds.samples) == ds.labels)<br><br>
</font><font color="#800000">I also get:<br>
</font><font size=1>'gcc' is not recognized as an internal or external
command,<br>
operable program or batch file.<br>
Warning: Extremely bad integrand behavior occurs at some points of
the<br>
integration interval.<br>
Warning: Extremely bad integrand behavior occurs at some points of
the<br>
integration interval.<br>
C:\Python27\lib\site-packages\numpy\lib\function_base.py:1881:
RuntimeWarning: i<br>
nvalid value encountered in _cdf_single_call (vectorized)<br>
_res = array(self.ufunc(*newargs),copy=False,<br><br>
</font><font color="#800000">Best,<br>
</font><x-sigsep><p></x-sigsep>
<font face="Arial Black, Helvetica" size=5 color="#800000">Ray
Schumacher<br>
</font><font face="Arial Black, Helvetica">Programmer/Consultant</font>
</body>
</html>