Home | Trees | Indices | Help |
|
---|
|
1 # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- 2 # vi: set ft=python sts=4 ts=4 sw=4 et: 3 ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## 4 # 5 # See COPYING file distributed along with the PyMVPA package for the 6 # copyright and license terms. 7 # 8 ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## 9 """Unit tests for PyMVPA ridge regression classifier""" 10 11 from mvpa.clfs.ridge import RidgeReg 12 from scipy.stats import pearsonr 13 from tests_warehouse import * 141654 5518 # not the perfect dataset with which to test, but 19 # it will do for now. 20 data = datasets['dumb'] 21 22 clf = RidgeReg() 23 24 clf.train(data) 25 26 # prediction has to be almost perfect 27 # test with a correlation 28 pre = clf.predict(data.samples) 29 cor = pearsonr(pre,data.labels) 30 self.failUnless(cor[0] > .8)31 32 # do again for fortran implementation 33 # DISABLE for now, at it is known to be broken 34 # clf = RidgeReg(implementation='gradient') 35 # clf.train(data) 36 # cor = pearsonr(clf.predict(data.samples), data.labels) 37 # print cor 38 # self.failUnless(cor[0] > .8) 39 40 4157 return unittest.makeSuite(RidgeRegTests)58 59 60 if __name__ == '__main__': 61 import runner 62
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Mon Apr 23 23:09:41 2012 | http://epydoc.sourceforge.net |