Distance
polars_ts.distance
Unified entry point for pairwise distance computation.
compute_pairwise_distance(input1, input2, method='dtw', **kwargs)
Compute pairwise distance between time series using the specified method.
This is the unified entry point for all distance metrics. It dispatches
to the appropriate Rust implementation based on the method parameter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input1
|
DataFrame
|
DataFrame with columns |
required |
input2
|
DataFrame
|
DataFrame with the same schema as |
required |
method
|
Literal['dtw', 'ddtw', 'wdtw', 'msm', 'erp', 'lcss', 'twe', 'sbd', 'frechet', 'edr', 'dtw_multi', 'msm_multi']
|
The distance metric to use. One of: Univariate:
Multivariate:
|
'dtw'
|
**kwargs
|
Any
|
Method-specific parameters (see above). |
{}
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
A DataFrame with columns |
Raises:
| Type | Description |
|---|---|
ValueError
|
If an unknown method or unexpected keyword argument is passed. |
Examples:
_pick(kwargs, *keys)
Return a dict with only the keys that are present in kwargs.