Package mvpa :: Package clfs :: Package sg :: Module svm :: Class SVM
[hide private]
[frames] | no frames]

Class SVM

source code


Support Vector Machine Classifier(s) based on Shogun

This is a simple base interface

Nested Classes [hide private]

Inherited from misc.state.Stateful: __metaclass__

Instance Methods [hide private]
 
__init__(self, kernel_type='linear', svm_impl="libsvm", **kwargs)
This is the base class of all classifier that utilize so far just SVM classifiers provided by shogun.
source code
 
__repr__(self)
Definition of the object summary over the object
source code
 
__wasChanged(self, descr, i, entry)
Check if given entry was changed from what known prior.
source code
 
_train(self, dataset)
Train SVM
source code
 
_predict(self, data)
Predict values for the data
source code
 
untrain(self)
Reset trained state
source code

Inherited from _svmbase._SVM: getSensitivityAnalyzer

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

Inherited from base.Classifier: __str__, isTrained, predict, regression, train, train2predict, trained

Inherited from misc.state.Stateful: __getattribute__, __setattr__, reset

Inherited from object: __delattr__, __hash__, __new__, __reduce__, __reduce_ex__

Class Variables [hide private]
  num_threads = Parameter(1, min= 1, descr= 'Number of threads t...
  _KERNELS = {"linear":(shogun.Kernel.LinearKernel, (), LinearSV...
  _KNOWN_PARAMS = ['C', 'epsilon']
  _KNOWN_KERNEL_PARAMS = []
  _clf_internals = _SVM._clf_internals+ ['sg', 'retrainable']
Describes some specifics about the classifier -- is that it is doing regression for instance....
  svm = property(fget= lambda self: self.__svm)
Access to the SVM model.
  traindataset = property(fget= lambda self: self.__traindataset)
Dataset which was used for training

Inherited from _svmbase._SVM (private): _ATTRIBUTE_COLLECTIONS, _SVM_PARAMS

Inherited from base.Classifier: feature_ids, predicting_time, predictions, retrainable, trained_dataset, trained_labels, training_confusion, training_time, values

Instance Variables [hide private]
  __svm
Holds the trained svm.

Inherited from base.Classifier (private): _regression, _train2predict

Properties [hide private]

Inherited from misc.state.Stateful: descr

Inherited from object: __class__

Method Details [hide private]

__init__(self, kernel_type='linear', svm_impl="libsvm", **kwargs)
(Constructor)

source code 

This is the base class of all classifier that utilize so far just SVM classifiers provided by shogun.

TODO Documentation if this all works ;-)

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

__repr__(self)
(Representation operator)

source code 
Definition of the object summary over the object
Overrides: object.__repr__
(inherited documentation)

__wasChanged(self, descr, i, entry)

source code 
Check if given entry was changed from what known prior. If so -- store

_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

untrain(self)

source code 
Reset trained state
Overrides: base.Classifier.untrain
(inherited documentation)

Class Variable Details [hide private]

num_threads

Value:
Parameter(1, min= 1, descr= 'Number of threads to utilize')

_KERNELS

Value:
{"linear":(shogun.Kernel.LinearKernel, (), LinearSVMWeights), "rbf":(s\
hogun.Kernel.GaussianKernel, ('gamma',), None), "rbfshift":(shogun.Ker\
nel.GaussianShiftKernel, ('gamma', 'max_shift', 'shift_step'), None), \
"sigmoid":(shogun.Kernel.SigmoidKernel, ('cache_size', 'gamma', 'coef0\
'), None),}

traindataset

Dataset which was used for training

TODO -- might better become state variable I guess

Value:
property(fget= lambda self: self.__traindataset)