# alteryx/evalml architecture

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

- Interactive diagram: https://gitdiagram.com/alteryx/evalml
- Repository: https://github.com/alteryx/evalml

## Overview

##### Main Components and Their Purpose
- AutoML Engine: Represented by the automl module (found in evalml/automl). This component is responsible for orchestrating the search over candidate pipelines. It interacts with various submodules like automl_algorithm, pipelines, callbacks, and search progress.
- Pipeline Components: The pipelines module (in evalml/pipelines) contains different pipeline types (binary classification, regression, time series, multiclass classification, etc.) as well as the individual building blocks (preprocessors, estimators, transformers) found in subdirectories such as components/estimators and components/transformers.
- Data Checks: The data_checks module (in evalml/data_checks) contains a suite of checks (null values, class imbalance, multicollinearity, etc.) that are performed on the input data to certify its quality before modeling.
- Preprocessing: The preprocessing module (in evalml/preprocessing) is designed for data splitting and custom data pre‐processing functions.
- Model Understanding: This module (in evalml/model_understanding) gives insights into model behavior through techniques (partial dependence, permutation importance, decision boundaries, and force plots).
- Objectives: The objectives module (in evalml/objectives) provides domain-specific evaluation metrics as well as objective functions (like cost benefit matrices, fraud cost calculations, etc.) that help guide the pipeline optimization.
- Tuners: The tuners module (in evalml/tuners) encapsulates hyperparameter tuning algorithms including grid search, random search, and Bayesian optimization.
- Utilities: The utils module contains support functions (logging, CLI tools, nullable type handling) and serves as a backbone for the internal operations of each major module.
- Testing & CI/CD: Although not part of runtime architecture, the very extensive tests and GitHub workflows (in .github and evalml/tests) indicate that there is an automated continuous testing and integration process supporting the project.

##### Relationships and Interactions
- Data Flow: Start by indicating how input data (loaded via demo datasets or user-supplied data) flows into the preprocessing component where it is split and cleaned by performing data checks.
- Orchestration: The AutoMLSearch class (in automl) receives the prepared data and communicates with the pipeline construction modules to generate numerous candidate pipelines.
- Model Evaluation: Once pipelines are executed, the model understanding tools consume the pipeline outputs to produce interpretable visualizations or metrics.
- Hyperparameter Tuning: The tuners module integrates with the AutoML Engine to optimize pipelines over multiple iterations.
- External Dependencies: Highlight that EvalML integrates with external libraries (e.g., Woodwork, scikit-learn) which are implicitly referenced in the utilities and update checker.

##### Architectural Patterns and Design Strategies
- Modular Design: The project embraces a highly modular organization where each major concern (data checking, pipeline candidates, model evaluation, etc.) is encapsulated in its own submodule.
- Plug-and-Play Components: The design allows different estimators/transformers and tuners to be swapped depending on the problem type (binary, multiclass, time series, regression, etc.), evident from the structured separation in the file tree.
- Extensible API: The clear separation of concerns indicates that users can extend functionality (for example, add custom data checks or pipeline components) without altering the core engine.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Input Layer
    DI["Data Input (User-supplied or demo datasets)"]:::input

    %% Data Preparation Layer
    subgraph "Data Preparation"
        PRE["Preprocessing\n(Data splitting & cleaning)"]:::dataprep
        DC["Data Checks\n(Validation: nulls, imbalance, etc.)"]:::dataprep
    end

    %% Core Orchestration Layer
    subgraph "Core Orchestration"
        AE["AutoML Engine\n(Orchestrates search & pipeline optimization)"]:::core
        UT["Utilities\n(Support functions: logging, CLI, etc.)"]:::utils
    end

    %% Pipeline Construction & Execution Layer
    subgraph "Pipeline Construction & Execution"
        PC["Pipeline Components\n(Creates candidate pipelines)"]:::pipeline
        OBJ["Objectives\n(Evaluation metrics & functions)"]:::eval
        TNR["Tuners\n(Hyperparameter optimization)"]:::tuner
    end

    %% Model Evaluation & Interpretation Layer
    subgraph "Model Evaluation & Interpretation"
        MU["Model Understanding\n(Interpretation & visualizations)"]:::eval
        EXT["External Libraries\n(Woodwork, scikit-learn)"]:::external
    end

    %% CI/CD & Testing Layer
    subgraph "CI/CD & Testing"
        TEST["Testing\n(evalml/tests)"]:::ci
        CICD["CI/CD Workflows\n(.github)"]:::ci
    end

    %% Data Flow Connections
    DI --> PRE
    DI --> DC
    PRE --> AE
    DC --> AE
    AE --> PC
    AE --> TNR
    PC --> OBJ
    PC --> TNR
    PC --> MU
    OBJ --> AE
    MU --> AE
    UT --> AE
    UT --> PRE
    UT --> DC
    EXT --- UT

    %% CI/CD Integration (side connection)
    TEST --> CICD

    %% Click Events for Components with Mapped Paths
    click AE "https://github.com/alteryx/evalml/tree/main/evalml/automl"
    click PC "https://github.com/alteryx/evalml/tree/main/evalml/pipelines"
    click DC "https://github.com/alteryx/evalml/tree/main/evalml/data_checks"
    click PRE "https://github.com/alteryx/evalml/tree/main/evalml/preprocessing"
    click MU "https://github.com/alteryx/evalml/tree/main/evalml/model_understanding"
    click OBJ "https://github.com/alteryx/evalml/tree/main/evalml/objectives"
    click TNR "https://github.com/alteryx/evalml/tree/main/evalml/tuners"
    click UT "https://github.com/alteryx/evalml/tree/main/evalml/utils"
    click CICD "https://github.com/alteryx/evalml/blob/main/.github"
    click TEST "https://github.com/alteryx/evalml/tree/main/evalml/tests"

    %% Styling Classes
    classDef input fill:#fce94f,stroke:#333,stroke-width:2px;
    classDef dataprep fill:#8ae234,stroke:#333,stroke-width:2px;
    classDef core fill:#729fcf,stroke:#333,stroke-width:2px;
    classDef pipeline fill:#ad7fa8,stroke:#333,stroke-width:2px;
    classDef eval fill:#ef2929,stroke:#333,stroke-width:2px;
    classDef tuner fill:#fcaf3e,stroke:#333,stroke-width:2px;
    classDef utils fill:#34e2eb,stroke:#333,stroke-width:2px;
    classDef ci fill:#d3d7cf,stroke:#333,stroke-width:2px;
    classDef external fill:#c4a000,stroke:#333,stroke-width:2px;
```
