Hi<br><br>After having learned 0.4 I am now re-writting my code using 0.6. I notice that several things have changed, for instance splitters become partitioners, and nperlabel has disappeared. I am now using a Balancer in a ChainNode with a partitioner (following one of the examples):<br>
<br>cv = CrossValidation(SMLR(), \<br> ChainNode([NGroupPartitioner(5), Balancer()],space='partitions'), \<br> enable_ca=['stats','training_stats'])<br><br>I get an AttributeError, complaining about _pattr missing, which happens while converting to string the Balancer (see below)<br>
<br><br>ERROR: An unexpected error occurred while tokenizing input<br>The following traceback may be corrupted or invalid<br>The error message is: ('EOF in multi-line statement', (103, 0))<br><br>---------------------------------------------------------------------------<br>
AttributeError Traceback (most recent call last)<br><br>/media/data/Documents/CognitiveLoad/code/pycode/eeg/dataAnalysis.py in <module>()<br> 222 attr = DataAttributes(sids=['S04'])<br>
223 ds = makeDataSetAllSubjects(attr)<br>--> 224 c = classify(ds,['1','5'],nfolds=3)<br> 225 <br> 226 <br><br>/media/data/Documents/CognitiveLoad/code/pycode/eeg/dataAnalysis.py in classify(ds, labels, nfolds, show_confusion, classifier, **kwargs) <br>
188 enable_ca=['stats','training_stats'])<br> 189 <br>--> 190 terr = cv(DS)<br> 191 <br> 192 if show_confusion:<br><br>/usr/lib/pymodules/python2.6/mvpa/base/learner.pyc in __call__(self, ds)<br>
220 "used and auto training is disabled."<br> 221 % str(self))<br>--> 222 return super(Learner, self).__call__(ds)<br> 223 <br>
224 <br><br>/usr/lib/pymodules/python2.6/mvpa/base/node.pyc in __call__(self, ds)<br> 74 <br> 75 self._precall(ds)<br>---> 76 result = self._call(ds)<br> 77 result = self._postcall(ds, result)<br>
78 <br><br>/usr/lib/pymodules/python2.6/mvpa/measures/base.pyc in _call(self, ds)<br> 407 # always untrain to wipe out previous stats<br><br> 408 self.untrain()<br>--> 409 return super(CrossValidation, self)._call(ds)<br>
410 <br> 411 <br><br>/usr/lib/pymodules/python2.6/mvpa/measures/base.pyc in _call(self, ds)<br> 276 # run the node an all generated datasets<br><br> 277 results = []<br>--> 278 for i, sds in enumerate(generator.generate(ds)):<br>
279 if ca.is_enabled("datasets"):<br> 280 # store dataset in ca<br><br><br>/usr/lib/pymodules/python2.6/mvpa/base/node.pyc in generate(self, ds, startnode)<br> 245 else:<br>
246 # otherwise feed them through the rest of the chain<br><br>--> 247 for rgds in self.generate(gds, startnode=startnode + 1):<br> 248 yield rgds<br> 249 <br>
<br>/usr/lib/pymodules/python2.6/mvpa/base/node.pyc in generate(self, ds, startnode)<br> 237 % (self.__class__.__name__, ds.shape,<br> 238 startnode + 1, len(self),<br>--> 239 str(first_node)))<br>
240 # let the first node generator as many datasets as it wants <br><br> 241 for gds in first_node.generate(ds):<br><br>/usr/lib/pymodules/python2.6/mvpa/generators/resampling.pyc in __str__(self)<br>
184 <br> 185 def __str__(self):<br>--> 186 return _str(self, self._pattr, n=self.nruns, limit=self._limit,<br> 187 assure=self._assure_permute) <br>
188 <br><br>AttributeError: 'Balancer' object has no attribute '_pattr'<br><br><br>