[pymvpa] max key= python 2.4 test errors
Matthew Brett
matthew.brett at gmail.com
Fri Jan 15 21:26:46 UTC 2010
Hi guys,
I just installed pymvpa on an oldish Redhat system, and hit these
Python 2.4-related test errors:
======================================================================
ERROR: Test all classifiers for conformant behavior
----------------------------------------------------------------------
Traceback (most recent call last):
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/tests/test_clf.py",
line 631, in testGenericTests
clf.train(traindata)
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/clfs/base.py",
line 378, in train
self._posttrain(dataset)
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/clfs/base.py",
line 266, in _posttrain
predictions = self.predict(dataset.samples)
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/clfs/base.py",
line 450, in predict
result = self._predict(data)
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/clfs/knn.py",
line 149, in _predict
results = [vfx(knn) for knn in knns]
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/clfs/knn.py",
line 176, in getMajorityVote
return max(votes.iteritems(), key=lambda x:x[1])[0], \
TypeError: max() takes no keyword arguments
======================================================================
ERROR: testSplitClassifierExtended (mvpa.tests.test_clf.ClassifiersTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/tests/tests_warehouse.py",
line 67, in do_sweep
method(*args_, **kwargs_)
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/tests/test_clf.py",
line 213, in testSplitClassifierExtended
clf.train(ds) # train the beast
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/clfs/base.py",
line 368, in train
result = self._train(dataset)
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/clfs/meta.py",
line 1124, in _train
clf.train(split[0])
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/clfs/base.py",
line 378, in train
self._posttrain(dataset)
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/clfs/base.py",
line 266, in _posttrain
predictions = self.predict(dataset.samples)
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/clfs/base.py",
line 450, in predict
result = self._predict(data)
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/clfs/knn.py",
line 149, in _predict
results = [vfx(knn) for knn in knns]
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/clfs/knn.py",
line 176, in getMajorityVote
return max(votes.iteritems(), key=lambda x:x[1])[0], \
TypeError: max() takes no keyword arguments
======================================================================
ERROR: testSummary (mvpa.tests.test_clf.ClassifiersTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/tests/tests_warehouse.py",
line 67, in do_sweep
method(*args_, **kwargs_)
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/tests/test_clf.py",
line 144, in testSummary
clf.train(datasets['uni2small'])
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/clfs/base.py",
line 378, in train
self._posttrain(dataset)
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/clfs/base.py",
line 266, in _posttrain
predictions = self.predict(dataset.samples)
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/clfs/base.py",
line 450, in predict
result = self._predict(data)
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/clfs/knn.py",
line 149, in _predict
results = [vfx(knn) for knn in knns]
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/clfs/knn.py",
line 176, in getMajorityVote
return max(votes.iteritems(), key=lambda x:x[1])[0], \
TypeError: max() takes no keyword arguments
======================================================================
ERROR: testValues (mvpa.tests.test_clf.ClassifiersTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/tests/tests_warehouse.py",
line 67, in do_sweep
method(*args_, **kwargs_)
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/tests/test_clf.py",
line 421, in testValues
cverror = cv(ds)
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/measures/base.py",
line 105, in __call__
result = self._call(dataset)
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/algorithms/cvtranserror.py",
line 173, in _call
result = transerror(split[1], split[0])
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/clfs/transerror.py",
line 1302, in __call__
self._precall(testdataset, trainingdataset)
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/clfs/transerror.py",
line 1258, in _precall
self.__clf.train(trainingdataset)
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/clfs/base.py",
line 378, in train
self._posttrain(dataset)
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/clfs/base.py",
line 266, in _posttrain
predictions = self.predict(dataset.samples)
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/clfs/base.py",
line 450, in predict
result = self._predict(data)
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/clfs/knn.py",
line 149, in _predict
results = [vfx(knn) for knn in knns]
File "/imaging/local/linux/lib/python2.4/site-packages/mvpa4.3.1/mvpa/clfs/knn.py",
line 176, in getMajorityVote
return max(votes.iteritems(), key=lambda x:x[1])[0], \
TypeError: max() takes no keyword arguments
----------------------------------------------------------------------
Ran 227 tests in 43.596s
This was on your latest downloadable snapshot and the 0.4.3 release tarball.
By the way, I was looking around but couldn't see the incantation for
http git cloning of the repository - is it obvious - sorry if I missed
it.
See you,
Matthew
More information about the Pkg-ExpPsy-PyMVPA
mailing list