# aeon-toolkit/aeon architecture

> Architecture diagram of the GitHub repository aeon-toolkit/aeon, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aeon-toolkit/aeon
- Repository: https://github.com/aeon-toolkit/aeon

## Overview

##### Project Type and Purpose
- aeon is an open-source Python toolkit for time series machine learning, providing algorithms for classification, regression, clustering, forecasting, anomaly detection, transformations, similarity search, visualization, benchmarking, and more.
- It follows a plugin-style architecture: core base classes define the API and contract, with concrete estimators and transformers implemented in subpackages.

##### High-Level Component Breakdown
a. Core Base Layer (highlighting base classes)
- aeon.base._base (BaseEstimator, BaseSeries, BaseCollection)
- aeon.base._compose (pipeline/ensemble composition logic)
- aeon.pipeline._make_pipeline, aeon.pipeline._sklearn_to_aeon
b. Algorithm Modules
- classification (distance-based, dictionary-based, deep_learning, feature-based, hybrid, interval-based, shapelet-based, sklearn wrappers, etc.)
- regression (same structure as classification)
- clustering
- forecasting
- anomaly_detection
- segmentation
- similarity_search
- transformations (series & collection)
- benchmarking (metrics, resampling, published_results loaders)
c. Data & IO Layer
- aeon.datasets: data loaders, single-problem loaders, time series anomaly detection datasets
- file formats (.ts, .arff, .csv)
d. Utility & Support Packages
- aeon.utils (conversion, discovery, numba helpers, validation, tags, network weight norm, show_versions)
- aeon.testing (data generation, estimator checking, mock_estimators, expected_results)
e. Deep-Learning Network Layer
- aeon.networks: implementations of CNN, RNN, autoencoders, etc., used by classification/regression/deep modules
f. Visualization Layer
- aeon.visualisation: estimator plotting, learning task plotting, results plotting, series/collection plotting
g. External Integrations
- scikit-learn compatibility
- numba JIT for performance
- binder, GitHub Actions, ReadTheDocs, PyPI/Conda packaging

##### Relationships & Data Flows
- Pipeline Layer orchestrates Algorithm Modules (composition, sklearn interop).
- Testing Layer targets every module (estimator_checking, unit tests).
- Documentation Generation (docs folder, Sphinx) reads code and README.
- CI/CD (GitHub Actions) triggers tests, type checks, codecov, release workflows.
- Packaging & Distribution (pyproject.toml → PyPI/Conda).

##### Architectural Patterns & Design Principles
- Inheritance & Polymorphism: all estimators extend core base classes to adhere to a uniform API.
- Composition: pipelines and ensemble constructors reside in _compose modules.
- Plugin/Registration: base._register and utils.discovery enable automatic estimator discovery.
- Layered Architecture: Data→Core API→Algorithm Implementations→Visualization/Benchmarking→Presentation.
- Separation of Concerns: each subpackage has its own tests directory; testing and CI are decoupled.

- Components:
– Data & IO (cyan)
– Utilities & Testing (orange)
– Network Layer (violet)
– Visualization & Benchmarking (lime)
– CI/CD & Packaging (purple)
– External Services (grey)
- Labels:
– Clearly label package names and key classes (e.g., “BaseEstimator”).

##### Highlighting Base Classes Usage
- Subclass hierarchy fans: classification, regression, clustering, forecasting, anomaly_detection, segmentation, similarity_search, transformations all inherit from BaseSeries or BaseCollection.
- “_register” and “discovery” utilities linking new subclass registration to the central registry.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Services
    EXT["External Services\nBinder, GitHub Actions,\nReadTheDocs, PyPI/Conda"]:::external

    %% CI/CD & Packaging
    subgraph "CI/CD & Packaging"
        CI[".github/workflows/"]:::ci
        PK["pyproject.toml"]:::ci
        DOCCFG[".readthedocs.yml"]:::ci
        DOCS["docs/"]:::ci
    end

    EXT --> CI
    CI --> TEST
    CI --> DOCS
    CI --> PK

    %% Data & IO Layer
    DIO["aeon.datasets"]:::data
    DATAFMT[".ts/.arff/.csv formats"]:::data

    DIO -->|"loads data"| CLF
    DIO -->|"loads data"| REG
    DIO -->|"loads data"| CLU
    DIO -->|"loads data"| FOR
    DIO -->|"loads data"| ANO

    %% Core Base Layer
    subgraph "Core Base Layer"
        BB["_base.py\n(BaseEstimator)"]:::core
        BS["_base_series.py\n(BaseSeries)"]:::core
        BC["_base_collection.py\n(BaseCollection)"]:::core
        CMP["_compose.py\n(pipeline/ensemble)"]:::core
    end

    %% Pipeline Layer
    subgraph "Pipeline Layer"
        MP["_make_pipeline.py"]:::pipeline
        SK["_sklearn_to_aeon.py"]:::pipeline
    end

    MP --> CMP
    SK --> CMP

    %% Algorithm Modules
    subgraph "Algorithm Modules"
        CLF["classification"]:::alg
        REG["regression"]:::alg
        CLU["clustering"]:::alg
        FOR["forecasting"]:::alg
        ANO["anomaly_detection"]:::alg
        SEG["segmentation"]:::alg
        SIM["similarity_search"]:::alg
        TRA["transformations"]:::alg
        BEN["benchmarking"]:::alg2
    end

    CLF -->|"inherits"| BS
    REG -->|"inherits"| BS
    CLU -->|"inherits"| BS
    FOR -->|"inherits"| BS
    ANO -->|"inherits"| BS
    SEG -->|"inherits"| BS
    SIM -->|"inherits"| BS
    TRA -->|"inherits"| BS
    BEN -->|"inherits"| BS

    %% Dependencies
    CLF -->|"uses utils"| UTIL
    REG -->|"uses utils"| UTIL
    CLU -->|"uses utils"| UTIL
    FOR -->|"uses utils"| UTIL
    ANO -->|"uses utils"| UTIL
    SEG -->|"uses utils"| UTIL
    SIM -->|"uses utils"| UTIL
    TRA -->|"uses utils"| UTIL
    BEN -->|"uses utils"| UTIL

    CLF -->|"uses networks"| NET
    REG -->|"uses networks"| NET

    CLF -->|"plots results"| VIS
    BEN -->|"plots results"| VIS

    %% Utility & Testing
    subgraph "Utility & Testing"
        UTIL["aeon.utils"]:::util
        TEST["aeon.testing"]:::test
    end

    %% Deep-Learning Network Layer
    subgraph "Deep-Learning Network Layer"
        NET["aeon.networks"]:::network
    end

    %% Visualization Layer
    subgraph "Visualization Layer"
        VIS["aeon.visualisation"]:::viz
    end

    %% Click Events
    click BB "https://github.com/aeon-toolkit/aeon/blob/main/aeon/base/_base.py"
    click BS "https://github.com/aeon-toolkit/aeon/blob/main/aeon/base/_base_series.py"
    click BC "https://github.com/aeon-toolkit/aeon/blob/main/aeon/base/_base_collection.py"
    click CMP "https://github.com/aeon-toolkit/aeon/blob/main/aeon/base/_compose.py"
    click MP "https://github.com/aeon-toolkit/aeon/blob/main/aeon/pipeline/_make_pipeline.py"
    click SK "https://github.com/aeon-toolkit/aeon/blob/main/aeon/pipeline/_sklearn_to_aeon.py"
    click CLF "https://github.com/aeon-toolkit/aeon/tree/main/aeon/classification/"
    click REG "https://github.com/aeon-toolkit/aeon/tree/main/aeon/regression/"
    click CLU "https://github.com/aeon-toolkit/aeon/tree/main/aeon/clustering/"
    click FOR "https://github.com/aeon-toolkit/aeon/tree/main/aeon/forecasting/"
    click ANO "https://github.com/aeon-toolkit/aeon/tree/main/aeon/anomaly_detection/"
    click SEG "https://github.com/aeon-toolkit/aeon/tree/main/aeon/segmentation/"
    click SIM "https://github.com/aeon-toolkit/aeon/tree/main/aeon/similarity_search/"
    click TRA "https://github.com/aeon-toolkit/aeon/tree/main/aeon/transformations/"
    click BEN "https://github.com/aeon-toolkit/aeon/tree/main/aeon/benchmarking/"
    click DIO "https://github.com/aeon-toolkit/aeon/tree/main/aeon/datasets/"
    click UTIL "https://github.com/aeon-toolkit/aeon/tree/main/aeon/utils/"
    click TEST "https://github.com/aeon-toolkit/aeon/tree/main/aeon/testing/"
    click NET "https://github.com/aeon-toolkit/aeon/tree/main/aeon/networks/"
    click VIS "https://github.com/aeon-toolkit/aeon/tree/main/aeon/visualisation/"
    click CI "https://github.com/aeon-toolkit/aeon/tree/main/.github/workflows/"
    click PK "https://github.com/aeon-toolkit/aeon/blob/main/pyproject.toml"
    click DOCCFG "https://github.com/aeon-toolkit/aeon/blob/main/.readthedocs.yml"
    click DOCS "https://github.com/aeon-toolkit/aeon/tree/main/docs/"

    %% Styles
    classDef external fill:#cccccc,stroke:#333,stroke-width:1px;
    classDef ci fill:#d099f1,stroke:#933,stroke-width:1px;
    classDef data fill:#87cefa,stroke:#036,stroke-width:1px;
    classDef core fill:#add8e6,stroke:#036,stroke-width:1px;
    classDef pipeline fill:#98fb98,stroke:#060,stroke-width:1px;
    classDef alg fill:#90ee90,stroke:#070,stroke-width:1px;
    classDef alg2 fill:#c0f080,stroke:#070,stroke-width:1px;
    classDef util fill:#ffa500,stroke:#a50,stroke-width:1px;
    classDef test fill:#ffdead,stroke:#a50,stroke-width:1px;
    classDef network fill:#dda0dd,stroke:#905,stroke-width:1px;
    classDef viz fill:#bfff00,stroke:#5a5,stroke-width:1px;
```
