pycvi.config

Configure default parameters and shapes

Functions

default_ts_average_kwargs([user_kwargs])

Complete provided kwargs with default ones for time-series average functions

default_ts_distance_kwargs([user_kwargs])

Complete provided kwargs with default ones for time-series distance metrics

set_data_shape(X)

Returns a copy of the data but with the right shape (N, T, d)

pycvi.config.set_data_shape(X: numpy.ndarray) numpy.ndarray

Returns a copy of the data but with the right shape (N, T, d)

Acceptable input shapes and their corresponding output shapes:

  • (N,) -> (N, 1, 1)

  • (N, d) -> (N, 1, d)

  • (N, T, d) -> (N, T, d)

Parameters:

X (np.ndarray) – Original data

Returns:

The same data but re-shaped to match the requirements of the PyCVI package

Return type:

np.ndarray

Raises:
  • ShapeError – Raised if only one sample was given.

  • ShapeError – Raised if an invalid shape dimensions was provided (1<=dimensions<=3)

pycvi.config.default_ts_average_kwargs(user_kwargs: dict = {}) dict

Complete provided kwargs with default ones for time-series average functions

Add the following pairs to the user provided kwargs (whose value) will be overriden if a corresponding key-value pair is provided by the user:

{ "distance": "msm", "init_barycenter": "medoids", "method": "petitjean"

These kwargs are going to be used with the aeon.clustering.averaging.elastic_barycenter_average function, and in addition, by default (if "distance": "msm"), this function calls aeon.distances.msm_distance.

Returns:

Default time-series kwargs for average functions

Return type:

dict

pycvi.config.default_ts_distance_kwargs(user_kwargs: dict = {}) dict

Complete provided kwargs with default ones for time-series distance metrics

Adds a {"method" : "msm"} pair to the user provided kwargs (whose value will be overriden if a corresponding key-value pair is provided by the user).

If a custom callable is given (using the "CALLABLE" key) or if another method than "msm" is used, then the default kwargs are simply {}, which means only user-specified kwargs are used.

If no custom callable is given, the function used is aeon.distances.pairwise_distance

Returns:

Default Time-Series distance kwargs

Return type:

dict