| Multivariate Pattern Analysis in Python

### Navigation

- index
- next |
- previous |
- ExpPsy Project |
- NeuroDebian Project |
- PyMVPA 0.4.x Home |
- PyMVPA Home |
- Documentation »
- Module Reference »

This content refers to the previous stable release of PyMVPA. Please visit www.pymvpa.org for the most recent version of PyMVPA and its documentation.

# clfs.sg.svm

## Module: `clfs.sg.svm`

Inheritance diagram for `mvpa.clfs.sg.svm`:

Wrap the libsvm package into a very simple class interface.

## `SVM`

class `mvpa.clfs.sg.svm.``SVM`(kernel_type='linear', **kwargs)

  Bases: `mvpa.clfs._svmbase._SVM`

  Support Vector Machine Classifier(s) based on Shogun

  This is a simple base interface

  Note

  Available state variables:

  - feature_ids: Feature IDS which were used for the actual training.
  - predicting_time+: Time (in seconds) which took classifier to predict
  - predictions+: Most recent set of predictions
  - trained_dataset: The dataset it has been trained on
  - trained_labels+: Set of unique labels it has been trained on
  - trained_nsamples+: Number of samples it has been trained on
  - training_confusion: Confusion matrix of learning performance
  - training_time+: Time (in seconds) which took classifier to train
  - values+: Internal classifier values the most recent predictions are based on

  (States enabled by default are listed with +)

  See also

  Please refer to the documentation of the base class for more information:

  `_SVM`

  Interface class to Shogun’s classifiers and regressions.

  Default implementation is ‘libsvm’.

  SVM/SVR definition is dependent on specifying kernel, implementation type, and parameters for each of them which vary depending on the choices made.

  Desired implementation is specified in svm_impl argument. Here is the list if implementations known to this class, along with specific to them parameters (described below among the rest of parameters), and what tasks it is capable to deal with (e.g. regression, binary and/or multiclass classification).

  Implementations :

  Kernel choice is specified as a string argument kernel_type and it can be specialized with additional arguments to this constructor function. Some kernels might allow computation of per feature sensitivity.

  Kernels : |

  Parameters:

  - epsilon – Tolerance of termination criteria. (For nu-SVM default is 0.001). (Default: 5e-05)
  - num_threads – Number of threads to utilize. (Default: 1)
  - retrainable – Either to enable retraining for ‘retrainable’ classifier. (Default: False)
  - enable_states (None or list of basestring) – Names of the state variables which should be enabled additionally to default ones
  - disable_states (None or list of basestring) – Names of the state variables which should be disabled
  - kernel_type (basestr) – String must be a valid key for cls._KERNELS

  `svm`

    Access to the SVM model.

  `traindataset`

    Dataset which was used for training

    TODO – might better become state variable I guess

  `untrain`()

### Navigation

- index
- next |
- previous |
- ExpPsy Project |
- NeuroDebian Project |
- PyMVPA 0.4.x Home |
- PyMVPA Home |
- Documentation »
- Module Reference »