KinematicFeatures
Kinematic feature transformer - velocity, acceleration, curvature.
Takes a discrete N-dimensional space curve, N>=1, and computes a selection of kinematic features.
For noisy time series, is strongly recommended to pipeline this with KalmanFilterTransformerPK or KalmanFilterTransformerFP (prior), or other smoothing or trajectory fitting transformers, as this transformer does not carry out its own smoothing.
For min/max/quantiles of velocity etc, pipeline with SummaryTransformer (post).
For a time series input \(x(t)\), observed at discrete times, this transformer computes (when selected) discretized versions of:
"v"- vector of velocity: \(\vec{v}(t):= \Delta x(t)\)"v_abs"- absolute velocity: \(v(t):= \left| \Delta x(t) \right|\)"a"- vector of velocity: \(\vec{a}(t):= \Delta \Delta x(t)\)"a_abs"- absolute velocity: \(a(t):= \left| \Delta \Delta x(t) \right|\)"curv"- curvature: \(c(t):= \frac{\sqrt{v(t)^2 a(t)^2 - \left\langle \vec{v}(t), \vec{a}(t)\right\rangle^2}}{v(t)^3}\)
where \(\Delta\) denotes first finite differences, that is, \(\Delta z(t) = z(t) - z(t-1)\) for any discrete time series \(z(t)\).
Note: this estimator currently ignores non-equidistant location index, and considers only the integer location index.
Schnellstart
from sktime.transformations.kinematic import KinematicFeatures
estimator = KinematicFeatures(features=None)Parameter(1)
- featuresstr or list of str, optional, default=[“v_abs”, “a_abs”, “c_abs”]
list of features to compute, possible features:
“v” - vector of velocity
“v_abs” - absolute velocity
“a” - vector of acceleration
“a_abs” - absolute acceleration
“curv” - curvature
Beispiele
>>> import numpy as np
>>> import pandas as pd
>>> from sktime.transformations.kinematic import KinematicFeatures
>>> traj3d = pd. DataFrame (columns = ["x", "y", "z" ])
>>> traj3d ["x" ] = pd. Series (np. sin (np. arange (200) / 100))
>>> traj3d ["y" ] = pd. Series (np. cos (np. arange (200) / 100))
>>> traj3d ["z" ] = pd. Series (np. arange (200) / 100)
>>> t = KinematicFeatures ()
>>> Xt = t. fit_transform (traj3d)