<html>
<body>
<font color="#800000">I've tried adapting 5-6 examples to my trial's
data, but other than the
</font><a href="http://v04.pymvpa.org/examples/smellit.html">Simple
Data-Exploration</a> <font color="#800000">example they all throw
exceptions and access violation 0x0000000 errors...<br>
I got past the numerix.ma error but the ctypes errors stumped me.<br>
I should try the .6 branch I suppose.<br>
Other ideas? Please?<br><br>
The data exploration:<br><br>
</font><font size=1>import numpy<br>
import pylab as P<br>
from mvpa.suite import *<br>
from mvpa.misc.plot import plotFeatureHist, plotSamplesDistance<br><br>
fh = open('con4.csv', 'r')<br>
lines = fh.readlines()<br>
fh.close()<br>
features = lines[0].split(',')[1:]<br><br>
labels = numpy.zeros((len(lines)-1), dtype=numpy.float32)<br><br>
data = numpy.zeros((len(lines)-1, len(features)-1),
dtype=numpy.float32)<br>
print 'data shape', data.shape<br>
for smp in range(1,len(lines)-1):<br>
d = lines[smp].split(',')[1:]<br>
labels[smp] = d[1]<br>
data[smp, :] = lines[smp].split(',')[2:]<br><br>
ds = MaskedDataset(samples=data, labels=labels, chunks=1)<br><br>
# next only works with floating point data<br>
ds.setSamplesDType('float')<br><br>
# look at sample similiarity<br>
# Note, the decreasing similarity with increasing temporal distance<br>
# of the samples<br>
P.subplot(121)<br>
plotSamplesDistance(ds, sortbyattr='chunks')<br>
P.title('Sample distances (sorted by chunks)')<br><br>
P.subplot(122)<br>
plotSamplesDistance(ds, sortbyattr='labels')<br>
P.title('Sample distances (sorted by labels)')<br>
if cfg.getboolean('examples', 'interactive', True):<br>
P.show()<br><br>
# z-score features individually per chunk<br>
print 'Detrending data'<br>
detrend(ds, perchunk=True, model='regress', polyord=2)<br>
print 'Z-Scoring data'<br>
zscore(ds)<br><br>
P.subplot(121)<br>
plotSamplesDistance(ds, sortbyattr='chunks')<br>
P.title('Distances: z-scored, detrended (sorted by chunks)')<br>
P.subplot(122)<br>
plotSamplesDistance(ds, sortbyattr='labels')<br>
P.title('Distances: z-scored, detrended (sorted by labels)')<br>
if cfg.getboolean('examples', 'interactive', True):<br>
P.show()<br><br>
<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>