mvtsa.segmentation.CostKernel#

class mvtsa.segmentation.CostKernel(kernel='rbf', gamma=None, approx='auto', n_features=300, random_state=0)[source]#

Bases: BaseCost

Kernel cost (Harchaoui and Cappé, 2007; Arlot, Celisse and Harchaoui, 2019): dispersion of the segment in the feature space of a kernel, \(\sum_{i\in S}k_{ii}-\frac1{\lvert S\rvert}\sum_{i,j\in S}k_{ij}\). Detects changes of the whole distribution, not only of the mean.

Parameters:
kernel{“rbf”, “linear”, “cosine”}
gammafloat, optional

RBF bandwidth parameter; default: inverse of the median squared distance (median heuristic).

approx{“auto”, “exact”, “rff”}

"rff" uses n_features random Fourier features (Rahimi and Recht, 2007) and the L2 cost in that space (linear memory); "auto" switches to it above 6000 samples.