Back to models
Classifier

TimeSeriesSVCTslearn

Time Series Suppoer Vector Classifier, from tslearn.

Quickstart

python
from sktime.classification.kernel_based import TimeSeriesSVCTslearn

estimator = TimeSeriesSVCTslearn(C=1.0, kernel='gak', degree=3, gamma='auto', coef0=0.0, shrinking=True, probability=False, tol=0.001, cache_size=200, class_weight=None, n_jobs=None, verbose=0, max_iter=-1, decision_function_shape='ovr', random_state=None)

Parameters(15)

Cfloat, optional (default=1.0)
Penalty parameter C of the error term.
kernelstring, optional (default=’gak’)

Specifies the kernel type to be used in the algorithm. It must be one of ‘gak’ or a kernel accepted by sklearn.svm.SVC. If none is given, ‘gak’ will be used. If a callable is given it is used to pre-compute the kernel matrix from data matrices; that matrix should be an array of shape (n_samples, n_samples).

degreeint, optional (default=3)
Degree of the polynomial kernel function (‘poly’). Ignored by all other kernels.
gammafloat, optional (default=’auto’)

Kernel coefficient for ‘gak’, ‘rbf’, ‘poly’ and ‘sigmoid’. If gamma is ‘auto’ then:

  • for ‘gak’ kernel, it is computed based on a sampling of the training set tslearn.metrics.gamma_soft_dtw

  • for other kernels (eg. ‘rbf’), 1/n_features will be used.

coef0float, optional (default=0.0)
Independent term in kernel function. It is only significant in ‘poly’ and ‘sigmoid’.
shrinkingboolean, optional (default=True)
Whether to use the shrinking heuristic.
probabilityboolean, optional (default=False)
Whether to enable probability estimates. This must be enabled prior to calling fit, and will slow down that method. Also, probability estimates are not guaranteed to match predict output. See our dedicated user guide section for more details.
tolfloat, optional (default=1e-3)
Tolerance for stopping criterion.
cache_sizefloat, optional (default=200.0)
Specify the size of the kernel cache (in MB).
class_weight{dict, ‘balanced’}, optional

Set the parameter C of class i to class_weight[i]*C for SVC. If not given, all classes are supposed to have weight one. The “balanced” mode uses the values of y to automatically adjust weights inversely proportional to class frequencies in the input data as n_samples / (n_classes * np.bincount(y))

n_jobsint or None, optional (default=None)

The number of jobs to run in parallel for GAK cross-similarity matrix computations. None means 1 unless in a joblib.parallel_backend context. -1 means using all processors. See scikit-learns’ Glossary for more details.

verboseint, default: 0
Enable verbose output. Note that this setting takes advantage of a per-process runtime setting in libsvm that, if enabled, may not work properly in a multithreaded context.
max_iterint, optional (default=-1)
Hard limit on iterations within solver, or -1 for no limit.
decision_function_shape‘ovo’, ‘ovr’, default=’ovr’
Whether to return a one-vs-rest (‘ovr’) decision function of shape (n_samples, n_classes) as all other classifiers, or the original one-vs-one (‘ovo’) decision function of libsvm which has shape (n_samples, n_classes * (n_classes - 1) / 2).
random_stateint, RandomState instance or None, optional (default=None)
The seed of the pseudo random number generator to use when shuffling the data. If int, random_state is the seed used by the random number generator; If RandomState instance, random_state is the random number generator; If None, the random number generator is the RandomState instance used by np.random.