Compute LB_Keogh.
LB_Keogh was originally presented in [1].
Univariate query time series to compare to the envelope of the candidate.
Univariate candidate time series. None means the envelope is provided via envelope_candidate parameter and hence does not need to be computed again.
Radius to be used for the envelope generation (the envelope at time index i will be generated based on all observations from the candidate time series at indices comprised between i-radius and i+radius). Not used if ts_candidate is None.
Pre-computed envelope of the candidate time series. If set to None, it is computed based on ts_candidate.
Distance between the query time series and the envelope of the candidate time series.
Notes
This method requires a ts_query and ts_candidate (or envelope_candidate, depending on the call) to be of equal size.
References
[1]Keogh, E. Exact indexing of dynamic time warping. In International Conference on Very Large Data Bases, 2002. pp 406-417.
Examples
>>> ts1 = [1, 2, 3, 2, 1] >>> ts2 = [0, 0, 0, 0, 0] >>> env_low, env_up = lb_envelope(ts1, radius=1) >>> float(lb_keogh(ts_query=ts2, ... envelope_candidate=(env_low, env_up))) 2.8284... >>> float(lb_keogh(ts_query=ts2, ... ts_candidate=ts1, ... radius=1)) 2.8284...
tslearn.metrics.lb_keogh
¶
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4