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 """Provides `clfs` dictionary with instances of all available classifiers.""" 10 11 __docformat__ = 'restructuredtext' 12 13 # Some global imports useful through out unittests 14 from mvpa.base import cfg 15 16 # 17 # first deal with classifiers which do not have external deps 18 # 19 from mvpa.clfs.smlr import SMLR 20 from mvpa.clfs.knn import * 21 22 from mvpa.clfs.warehouse import clfswh, regrswh 23 from mvpa.base import externals 24 25 # if have ANY svm implementation 26 if externals.exists('libsvm') or externals.exists('shogun'): 27 from mvpa.clfs.svm import * 28 29 # 30 # Few silly classifiers 31 #33 """Dummy classifier which reports +1 class if both features have 34 the same sign, -1 otherwise""" 35 36 _clf_internals = ['notrain2predict'] 39 4352 53 63 64 # Sample universal classifiers (linear and non-linear) which should be 65 # used whenever it doesn't matter what classifier it is for testing 66 # some higher level creations -- chosen so it is the fastest universal 67 # one. Also it should not punch state.py in the face how it is 68 # happening with kNN... 69 sample_clf_lin = SMLR(lm=0.1)#sg.svm.LinearCSVMC(svm_impl='libsvm') 70 71 #if externals.exists('shogun'): 72 # sample_clf_nl = sg.SVM(kernel_type='RBF', svm_impl='libsvm') 73 #else: 74 #classical one which was used for a while 75 #and surprisingly it is not bad at all for the unittests 76 sample_clf_nl = kNN(k=5) 77 78 # and also a regression-based classifier 79 r = clfswh['linear', 'regression', 'has_sensitivity'] 80 if len(r) > 0: sample_clf_reg = r[0] 81 else: sample_clf_reg = None 82
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Mon Apr 23 23:09:42 2012 | http://epydoc.sourceforge.net |