tdaad.utils package๏ƒ

Submodules๏ƒ

tdaad.utils.local_elliptic_envelope module๏ƒ

Pandas Elliptic Envelope.

tdaad.utils.local_elliptic_envelope.pandas_mahalanobis(self, X)[source]๏ƒ

Compute the negative Mahalanobis distances of embedding matrix X.

Parameters:

X (array-like of shape (n_samples, n_features)) โ€“ The embedding matrix.

Returns:

negative_mahal_distances โ€“ Opposite of the Mahalanobis distances.

Return type:

pandas.DataFrame of shape (n_samples,)

tdaad.utils.local_elliptic_envelope.pandas_score_samples(self, X)[source]๏ƒ

Compute the negative Mahalanobis distances.

Parameters:

X (array-like of shape (n_samples, n_features)) โ€“ The data matrix.

Returns:

negative_mahal_distances โ€“ Opposite of the Mahalanobis distances.

Return type:

array-like of shape (n_samples,)

tdaad.utils.local_pipeline module๏ƒ

Window Functions.

class tdaad.utils.local_pipeline.LocalPipeline(steps, *, transform_input=None, memory=None, verbose=False)[source]๏ƒ

Bases: Pipeline

Local pipeline modification for added functionality.

set_score_request(*, sample_weight: bool | None | str = '$UNCHANGED$') LocalPipeline๏ƒ

Request metadata passed to the score method.

Note that this method is only relevant if enable_metadata_routing=True (see sklearn.set_config()). Please see User Guide on how the routing mechanism works.

The options for each parameter are:

  • True: metadata is requested, and passed to score if provided. The request is ignored if metadata is not provided.

  • False: metadata is not requested and the meta-estimator will not pass it to score.

  • None: metadata is not requested, and the meta-estimator will raise an error if the user provides it.

  • str: metadata should be passed to the meta-estimator with this given alias instead of the original name.

The default (sklearn.utils.metadata_routing.UNCHANGED) retains the existing request. This allows you to change the request for some parameters and not others.

Added in version 1.3.

Note

This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a Pipeline. Otherwise it has no effect.

Parameters:

sample_weight (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) โ€“ Metadata routing for sample_weight parameter in score.

Returns:

self โ€“ The updated object.

Return type:

object

tdaad.utils.remapping_functions module๏ƒ

Remapping Functions.

tdaad.utils.remapping_functions.score_flat_fast_remapping(scores, window_size, stride, padding_length=0)[source]๏ƒ

Univariate score remapping without window indices and with precomputed padding_length.

tdaad.utils.window_functions module๏ƒ

Window Functions.

tdaad.utils.window_functions.sliding_window_ppl(data, pipeline, step=5, window_size=120)[source]๏ƒ

Applies a pipeline to timeseries data chunks using the Sliding Window algorithm.

@param data: pd.DataFrame with index to apply named_pipeline to. @param window_size: size of the sliding window algorithm to extract subsequences as input to named_pipeline. @param step: size of the sliding window steps between each window. @param pipeline: pipeline (sequence of operators that have a name attribute) to apply to each window. @return: pd.DataFrame that maps data to the result of applying named_pipeline to window view of data.

Module contents๏ƒ