← Về thư mục
📄 / / profiles / r-and-d / raw_evidence / scientific-agent-skills / skills / aeon / references / clustering.md

Time Series Clustering

Aeon provides clustering algorithms adapted for temporal data with specialized distance metrics and averaging methods.

Partitioning Algorithms

Standard k-means/k-medoids adapted for time series:

Use when: Known number of clusters, spherical cluster shapes expected.

Large Dataset Methods

Efficient clustering for large collections:

Use when: Dataset too large for standard k-medoids, need scalability.

Elastic Distance Clustering

Specialized for alignment-based similarity:

Use when: Time series have temporal shifts or warping.

Spectral Methods

Graph-based clustering:

Use when: Non-convex cluster shapes, need graph-based approach.

Deep Learning Clustering

Neural network-based clustering with auto-encoders:

Use when: Large datasets, need learned representations, or complex patterns.

Feature-Based Clustering

Transform to feature space before clustering:

Use when: Raw time series not informative, need interpretable features.

Composition

Build custom clustering pipelines:

Averaging Methods

Compute cluster centers for time series:

Use when: Need representative cluster centers for visualization or initialization.

Quick Start

from aeon.clustering import TimeSeriesKMeans
from aeon.datasets import load_classification

# Load data (using classification data for clustering)
X_train, _ = load_classification("GunPoint", split="train")

# Cluster time series
clusterer = TimeSeriesKMeans(
    n_clusters=3,
    distance="dtw",  # Use DTW distance
    averaging_method="ba"  # Barycentric averaging
)
labels = clusterer.fit_predict(X_train)
centers = clusterer.cluster_centers_

Algorithm Selection

Distance Metrics

Compatible distance metrics include: - Euclidean, Manhattan, Minkowski (lock-step) - DTW, DDTW, WDTW (elastic with alignment) - ERP, EDR, LCSS (edit-based) - MSM, TWE (specialized elastic)

Evaluation

Use clustering metrics from sklearn or aeon benchmarking: - Silhouette score - Davies-Bouldin index - Calinski-Harabasz index