| Home | Trees | Indices | Help |
|
|---|
|
|
1 #emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*-
2 #ex: set 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 #
14 # first deal with classifiers which do not have external deps
15 #
16 from mvpa.clfs.smlr import SMLR
17 from mvpa.clfs.knn import *
18
19 from mvpa.clfs.warehouse import clfswh, regrswh
20 from mvpa.base import externals
21
22 # if have ANY svm implementation
23 if externals.exists('libsvm') or externals.exists('shogun'):
24 from mvpa.clfs.svm import *
25
26 #
27 # Few silly classifiers
28 #
30 """Dummy classifier which reports +1 class if both features have
31 the same sign, -1 otherwise"""
32
33 _clf_internals = ['notrain2predict']
36
40
49
50
60
61 # Sample universal classifiers (linear and non-linear) which should be
62 # used whenever it doesn't matter what classifier it is for testing
63 # some higher level creations -- chosen so it is the fastest universal
64 # one. Also it should not punch state.py in the face how it is
65 # happening with kNN...
66 sample_clf_lin = SMLR(lm=0.1)#sg.svm.LinearCSVMC(svm_impl='libsvm')
67
68 #if externals.exists('shogun'):
69 # sample_clf_nl = sg.SVM(kernel_type='RBF', svm_impl='libsvm')
70 #else:
71 #classical one which was used for a while
72 #and surprisingly it is not bad at all for the unittests
73 sample_clf_nl = kNN(k=5)
74
75 # and also a regression-based classifier
76 r = clfswh['linear', 'regression', 'has_sensitivity']
77 if len(r) > 0: sample_clf_reg = r[0]
78 else: sample_clf_reg = None
79
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0beta1 on Mon Feb 23 10:50:08 2009 | http://epydoc.sourceforge.net |