temporalmapper.MapperClusterer

class temporalmapper.MapperClusterer(base_clusterer: ClusterMixin = None, mapper_params: dict | None = None, time_index: int = -1, drop_time: bool = True)

Mapper based sklearn compliant clusterer.

The last column (or specified time_index) of X is interpreted as a time coordinate and is used to guide the clustering procedure.

Parameters:
  • base_clusterer (sklearn-style clusterer, default=None) – The base clustering algorithm used within each temporal slice. Must implement fit and produce cluster labels.

  • mapper_params (dict, default=None) – Keyword arguments passed to TemporalMapper.

  • time_index (int, default=-1) – Index of the column in X that contains time values. This column will be excluded from the feature matrix before clustering.

labels_

Cluster labels assigned to each input sample.

Type:

ndarray of shape (n_samples,)

mapper_

Fitted TemporalMapper instance.

Type:

TemporalMapper

n_features_in_

Number of features seen during fit.

Type:

int

Notes

The input X must be a 2D array where one column represents time and the remaining columns represent feature values.

__init__(base_clusterer: ClusterMixin = None, mapper_params: dict | None = None, time_index: int = -1, drop_time: bool = True)

Methods

__init__([base_clusterer, mapper_params, ...])

fit(X[, y])

Fit the MapperClusterer on the given data.

fit_predict(X[, y])

Perform clustering on X and returns cluster labels.

get_metadata_routing()

Get metadata routing of this object.

get_params([deep])

Get parameters for this estimator.

set_params(**params)

Set the parameters of this estimator.