| digest: | Series Classification with K-Nearest Neighbours using Dynamic Time Warping | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| species: | data | ||||||||
| sc-categories: | Classification, DTW | ||||||||
| sc-related: | |||||||||
| see-also: | DTW, DataSeries, LabelSet | ||||||||
| description: | A nearest neighbour classifier using a :fluid-obj:`DTW` | ||||||||
| discussion: | To keep with the interface of the :fluid-obj:`KNNClassifier`, the DTWClassifier must first be To classify a series, Keep in mind that this is a brute-force measure, so evaluation will become very slow for large numbers of series, or long series. |
||||||||
| control numNeighbours: | The number of neighbours to consider | ||||||||
| control constraint: | The constraint to use in the DTW algorithm when calculating the distance between two time series. 'Warping' in this context means how distorted the genral shape of the series is. For example, a pulse with a fast attack and slow decay will register as identical to the case with fast decay and slow attack, since stretching the time series can make it match in shape. If constraints are applied however, the amount of warping is restricted, so that the general shape of the series is kept. See https://rtavenar.github.io/blog/dtw.html#setting-additional-constraints for a beautiful visual explanation of the constraints
|
||||||||
| control constraintParam: | The maximum radius a frame can warp away from its initial location when using a sakoe-chiba constraint, and parameter for the ikatura constraint when using that. A higher value results in being able to warp more. See https://rtavenar.github.io/blog/dtw.html#setting-additional-constraints for an explanation of the significance. |
||||||||
| message fit: |
Fit the model to a source :fluid-obj:`DataSeries` and a target :fluid-obj:`LabelSet`. The labels in the :fluid-obj:`LabelSet` correspond to the data points in the :fluid-obj:`DataSeries` by means of a shared identifier. |
||||||||
| message predict: |
Given the fitted model, predict labels for a :fluid-obj:`DataSeries` and write these to a :fluid-obj:`LabelSet` |
||||||||
| message predictSeries: |
Given a fitted model, predict a label for a data series in |buffer| and return to the caller |
||||||||
| message clear: | Clears the :fluid-obj:`DataSeries` and :fluid-obj:`LabelSet` |