Package mvpa :: Package clfs :: Package libsvmc :: Module svm :: Class SVM

[hide private]
[frames] | no frames]

# Class SVM

source code

Support Vector Machine Classifier.

This is a simple interface to the libSVM package.

Nested Classes | [hide private]

Inherited from `misc.state.ClassWithCollections`: `__metaclass__`

Instance Methods | [hide private]

__init__(self, kernel_type='linear', **kwargs) Interface class to LIBSVM classifiers and regressions. | source code

_train(self, dataset) Train SVM | source code

_predict(self, data) Predict values for the data | source code

summary(self) Provide quick summary over the SVM classifier | source code

untrain(self) Untrain libsvm's SVM: forget the model | source code

Inherited from `_svmbase._SVM`: `__repr__`, `getSensitivityAnalyzer`

Inherited from `_svmbase._SVM` (private): `_getDefaultC`, `_getDefaultGamma`

Inherited from `base.Classifier`: `__str__`, `clone`, `isTrained`, `predict`, `repredict`, `retrain`, `train`, `trained`

Inherited from `base.Classifier` (private): `_getFeatureIds`, `_postpredict`, `_posttrain`, `_prepredict`, `_pretrain`, `_regressionIsBogus`, `_setRetrainable`

Inherited from `misc.state.ClassWithCollections`: `__getattribute__`, `__new__`, `__setattr__`, `reset`

Inherited from `object`: `__delattr__`, `__format__`, `__hash__`, `__reduce__`, `__reduce_ex__`, `__sizeof__`, `__subclasshook__`

Class Methods | [hide private]

Inherited from `_svmbase._SVM` (private): `_customizeDoc`

Class Variables | [hide private]

| probabilities = `StateVariable(enabled= False, doc= "Estimates `...``
| _KERNELS = `{"linear":(svm.svmc.LINEAR, None, LinearSVMWeights)`...``
| _KNOWN_PARAMS = `['epsilon', 'probability', 'shrinking', 'weigh`...``
| _KNOWN_KERNEL_PARAMS = `['cache_size']`
| _KNOWN_IMPLEMENTATIONS = `{'C_SVC':(svm.svmc.C_SVC, ('C',), ('b`...``
| _clf_internals = `_SVM._clf_internals+ ['libsvm']` Describes some specifics about the classifier -- is that it is doing regression for instance....
| model = `property(fget= lambda self: self.__model)` Access to the SVM model.
Inherited from `_svmbase._SVM` (private): `_ATTRIBUTE_COLLECTIONS`, `_SVM_PARAMS` Inherited from `base.Classifier`: `_DEV__doc__`, `feature_ids`, `predicting_time`, `predictions`, `regression`, `retrainable`, `trained_dataset`, `trained_labels`, `trained_nsamples`, `training_confusion`, `training_time`, `values` Inherited from `misc.state.ClassWithCollections`: `descr`

Instance Variables | [hide private]

| __model Holds the trained SVM.

Properties | [hide private]

Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, kernel_type='linear', **kwargs)
(Constructor)

source code

Interface class to LIBSVM classifiers and regressions.

Default implementation (C/nu/epsilon SVM) is chosen depending on the given parameters (C/nu/tube_epsilon).

Parameters:
  - `kernel_type` - String must be a valid key for cls._KERNELS
Overrides: object.__init__

### _train(self, dataset)

source code

Train SVM

Overrides: base.Classifier._train

### _predict(self, data)

source code

Predict values for the data

Overrides: base.Classifier._predict

### summary(self)

source code

Provide quick summary over the SVM classifier

Overrides: base.Classifier.summary

### untrain(self)

source code

Untrain libsvm's SVM: forget the model

Overrides: base.Classifier.untrain

Class Variable Details | [hide private]

### probabilities

Value:

      StateVariable(enabled= False, doc= "Estimates of samples probabilities
       as provided by LibSVM")

### _KERNELS

Value:

      {"linear":(svm.svmc.LINEAR, None, LinearSVMWeights), "rbf":(svm.svmc.R
      BF, ('gamma',), None), "poly":(svm.svmc.POLY, ('gamma', 'degree', 'coe
      f0'), None), "sigmoid":(svm.svmc.SIGMOID, ('gamma', 'coef0'), None),}

### _KNOWN_PARAMS

Value:

      ['epsilon', 'probability', 'shrinking', 'weight_label', 'weight']

### _KNOWN_IMPLEMENTATIONS

Value:

      {'C_SVC':(svm.svmc.C_SVC, ('C',), ('binary', 'multiclass'), 'C-SVM cla
      ssification'), 'NU_SVC':(svm.svmc.NU_SVC, ('nu',), ('binary', 'multicl
      ass'), 'nu-SVM classification'), 'ONE_CLASS':(svm.svmc.ONE_CLASS, (),
      ('oneclass',), 'one-class-SVM'), 'EPSILON_SVR':(svm.svmc.EPSILON_SVR,
      ('C', 'tube_epsilon'), ('regression',), 'epsilon-SVM regression'), 'NU
      _SVR':(svm.svmc.NU_SVR, ('nu', 'tube_epsilon'), ('regression',), 'nu-S
      VM regression')}