# yusrialsanaani/interpretability_of_machine_learning_models architecture

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

- Interactive diagram: https://gitdiagram.com/yusrialsanaani/interpretability_of_machine_learning_models
- Repository: https://github.com/yusrialsanaani/interpretability_of_machine_learning_models

## Overview

##### Main Components
- Data Source: Represent the dataset (the Parkinson’s Data Set from UCI) as the starting point.
- Data Preprocessing: Include a block for importing and cleaning the data from the dataset.
- Model Training: Create separate components (or a single “Model Training” block) that capture model building with multiple algorithms—most notably XGBoost (XGB) and Random Forest (RF).
- Prediction & Inference: Indicate where the trained models generate predictions.
- Interpretability Engine: Break this down into two subcomponents:
- SHAP: Highlight the use of SHAP to generate both global and local explanations based on Shap values.
- LIME: Indicate that LIME is used for producing local interpretability.
- Visualization & Error Analysis: A final component that represents the visualization outputs and the insights generated (e.g., interpretation plots) to aid in error analysis and build trust on model decisions.

##### Relationships and Data Flow
- From Model Training, indicate a flow towards the Prediction module.
- Finally, the results (explanatory visualizations and metrics) go to the Visualization & Error Analysis component.

##### Architectural Patterns and Principles
- That this setup follows a pipeline structure common in machine learning projects.
- The separation of concerns is clear: data ingestion, model execution, and post-hoc interpretation.
- That each module (especially within the Interpretability Engine) plays a distinct role in generating insights for either global or local model behavior.
- Indicators of dependencies like the use of SHAP’s dependency on Shap values and LIME’s focus on local approximations.

## Diagram (Mermaid)

```mermaid
graph TD
    PD["Project Documentation (README)"]:::doc
    DS["Dataset (Parkinson’s Data Set)"]:::dataset
    DP["Data Preprocessing"]:::process
    MT["Model Training – XGBoost & Random Forest"]:::training
    PI["Prediction & Inference"]:::prediction
    subgraph "Interpretability Engine"
        S["SHAP (Global & Local)"]:::interpret
        L["LIME (Local)"]:::interpret
    end
    VA["Visualization & Error Analysis"]:::viz

    PD --- DS
    DS -->|"feeds"| DP
    DP -->|"processes"| MT
    MT -->|"trains"| PI
    PI -->|"informs"| S
    MT -->|"contributes"| S
    PI -->|"explains"| L
    MT -->|"supports"| L
    S -->|"visualizes"| VA
    L -->|"visualizes"| VA

    click PD "https://github.com/yusrialsanaani/interpretability_of_machine_learning_models/blob/main/README.md"
    click DS "https://github.com/yusrialsanaani/interpretability_of_machine_learning_models/blob/main/XGB_RF_SHAP_LIME.ipynb"
    click DP "https://github.com/yusrialsanaani/interpretability_of_machine_learning_models/blob/main/XGB_RF_SHAP_LIME.ipynb"
    click MT "https://github.com/yusrialsanaani/interpretability_of_machine_learning_models/blob/main/XGB_RF_SHAP_LIME.ipynb"
    click PI "https://github.com/yusrialsanaani/interpretability_of_machine_learning_models/blob/main/XGB_RF_SHAP_LIME.ipynb"
    click S "https://github.com/yusrialsanaani/interpretability_of_machine_learning_models/blob/main/XGB_RF_SHAP_LIME.ipynb"
    click L "https://github.com/yusrialsanaani/interpretability_of_machine_learning_models/blob/main/XGB_RF_SHAP_LIME.ipynb"
    click VA "https://github.com/yusrialsanaani/interpretability_of_machine_learning_models/blob/main/XGB_RF_SHAP_LIME.ipynb"

    classDef dataset fill:#f9d423,stroke:#333,stroke-width:2px;
    classDef process fill:#f4a582,stroke:#333,stroke-width:2px;
    classDef training fill:#92c5de,stroke:#333,stroke-width:2px;
    classDef prediction fill:#d5d5e5,stroke:#333,stroke-width:2px;
    classDef interpret fill:#abdda4,stroke:#333,stroke-width:2px;
    classDef viz fill:#ffffbf,stroke:#333,stroke-width:2px;
    classDef doc fill:#c7e9c0,stroke:#333,stroke-width:2px;
```
