# cabral-e/diabetes-classificacao-ml architecture

> Architecture diagram of the GitHub repository cabral-e/diabetes-classificacao-ml, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cabral-e/diabetes-classificacao-ml
- Repository: https://github.com/cabral-e/diabetes-classificacao-ml

## Overview

This repository is a reproducible experiment comparing supervised classifiers for diabetes prediction from BRFSS 2015 health indicators. Its main workflow downloads the dataset, explores and prepares the data, splits it into training, validation, and test sets, compares four models on validation metrics, then evaluates the selected SVM on the held-out test set. The script is a single monolithic experiment, so nodes represent its distinct stages rather than separate modules. Relationships rely on the README and the shown script excerpts; unsampled implementation details are not inferred.

Main entry points: [`notebook/comparacao_algoritmos_diabetes.py`](https://github.com/cabral-e/diabetes-classificacao-ml/blob/main/notebook/comparacao_algoritmos_diabetes.py) (Validation comparison)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_download["Dataset download"]
  node_explore["Data exploration"]
  node_prepare["Data preparation"]
  node_split["Holdout split"]
  node_preprocess["Preprocessing"]
  node_smote["SMOTE balancing"]
end

subgraph group_experiment["Model comparison"]
  node_knn["KNN model"]
  node_svm["SVM model"]
  node_tree["Decision tree"]
  node_mlp["MLP model"]
end

subgraph group_evaluation["Evaluation and results"]
  node_compare["Validation comparison"]
  node_test["SVM test evaluation"]
  node_results["Metrics and plots"]
end

node_user(("Experiment runner"))
node_dataset["BRFSS dataset"]

node_user -->|"runs experiment"| node_download
node_download -->|"downloads"| node_dataset
node_dataset -->|"provides records"| node_explore
node_explore -->|"examines data"| node_prepare
node_prepare -->|"supplies features"| node_split
node_split -->|"provides training data"| node_preprocess
node_preprocess -->|"transforms training data"| node_smote
node_smote -->|"balances training data"| node_knn
node_smote -->|"balances training data"| node_svm
node_smote -->|"balances training data"| node_tree
node_smote -->|"balances training data"| node_mlp
node_knn -->|"predicts validation"| node_compare
node_svm -->|"predicts validation"| node_compare
node_tree -->|"predicts validation"| node_compare
node_mlp -->|"predicts validation"| node_compare
node_compare -->|"selects SVM"| node_test
node_svm -->|"predicts test set"| node_test
node_compare -->|"reports metrics"| node_results
node_test -->|"reports metrics"| node_results

click node_download "https://github.com/cabral-e/diabetes-classificacao-ml/blob/main/notebook/comparacao_algoritmos_diabetes.py"
click node_explore "https://github.com/cabral-e/diabetes-classificacao-ml/blob/main/notebook/comparacao_algoritmos_diabetes.py"
click node_prepare "https://github.com/cabral-e/diabetes-classificacao-ml/blob/main/notebook/comparacao_algoritmos_diabetes.py"
click node_split "https://github.com/cabral-e/diabetes-classificacao-ml/blob/main/notebook/comparacao_algoritmos_diabetes.py"
click node_preprocess "https://github.com/cabral-e/diabetes-classificacao-ml/blob/main/notebook/comparacao_algoritmos_diabetes.py"
click node_smote "https://github.com/cabral-e/diabetes-classificacao-ml/blob/main/notebook/comparacao_algoritmos_diabetes.py"
click node_knn "https://github.com/cabral-e/diabetes-classificacao-ml/blob/main/notebook/comparacao_algoritmos_diabetes.py"
click node_svm "https://github.com/cabral-e/diabetes-classificacao-ml/blob/main/notebook/comparacao_algoritmos_diabetes.py"
click node_tree "https://github.com/cabral-e/diabetes-classificacao-ml/blob/main/notebook/comparacao_algoritmos_diabetes.py"
click node_mlp "https://github.com/cabral-e/diabetes-classificacao-ml/blob/main/notebook/comparacao_algoritmos_diabetes.py"
click node_compare "https://github.com/cabral-e/diabetes-classificacao-ml/blob/main/notebook/comparacao_algoritmos_diabetes.py"
click node_test "https://github.com/cabral-e/diabetes-classificacao-ml/blob/main/notebook/comparacao_algoritmos_diabetes.py"
click node_results "https://github.com/cabral-e/diabetes-classificacao-ml/blob/main/notebook/comparacao_algoritmos_diabetes.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_download,node_explore,node_prepare,node_split,node_preprocess,node_smote toneBlue
class node_knn,node_svm,node_tree,node_mlp toneAmber
class node_compare,node_test,node_results toneMint
class node_user,node_dataset toneIndigo
```

## Components

### Data preparation

- [Dataset download](https://github.com/cabral-e/diabetes-classificacao-ml/blob/main/notebook/comparacao_algoritmos_diabetes.py): `notebook/comparacao_algoritmos_diabetes.py`
- [Data exploration](https://github.com/cabral-e/diabetes-classificacao-ml/blob/main/notebook/comparacao_algoritmos_diabetes.py): `notebook/comparacao_algoritmos_diabetes.py`
- [Data preparation](https://github.com/cabral-e/diabetes-classificacao-ml/blob/main/notebook/comparacao_algoritmos_diabetes.py): `notebook/comparacao_algoritmos_diabetes.py`
- [Holdout split](https://github.com/cabral-e/diabetes-classificacao-ml/blob/main/notebook/comparacao_algoritmos_diabetes.py): `notebook/comparacao_algoritmos_diabetes.py`
- [Preprocessing](https://github.com/cabral-e/diabetes-classificacao-ml/blob/main/notebook/comparacao_algoritmos_diabetes.py): `notebook/comparacao_algoritmos_diabetes.py`
- [SMOTE balancing](https://github.com/cabral-e/diabetes-classificacao-ml/blob/main/notebook/comparacao_algoritmos_diabetes.py): `notebook/comparacao_algoritmos_diabetes.py`

### Model comparison

- [KNN model](https://github.com/cabral-e/diabetes-classificacao-ml/blob/main/notebook/comparacao_algoritmos_diabetes.py): `notebook/comparacao_algoritmos_diabetes.py`
- [SVM model](https://github.com/cabral-e/diabetes-classificacao-ml/blob/main/notebook/comparacao_algoritmos_diabetes.py): `notebook/comparacao_algoritmos_diabetes.py`
- [Decision tree](https://github.com/cabral-e/diabetes-classificacao-ml/blob/main/notebook/comparacao_algoritmos_diabetes.py): `notebook/comparacao_algoritmos_diabetes.py`
- [MLP model](https://github.com/cabral-e/diabetes-classificacao-ml/blob/main/notebook/comparacao_algoritmos_diabetes.py): `notebook/comparacao_algoritmos_diabetes.py`

### Evaluation and results

- [Validation comparison](https://github.com/cabral-e/diabetes-classificacao-ml/blob/main/notebook/comparacao_algoritmos_diabetes.py): `notebook/comparacao_algoritmos_diabetes.py`
- [SVM test evaluation](https://github.com/cabral-e/diabetes-classificacao-ml/blob/main/notebook/comparacao_algoritmos_diabetes.py): `notebook/comparacao_algoritmos_diabetes.py`
- [Metrics and plots](https://github.com/cabral-e/diabetes-classificacao-ml/blob/main/notebook/comparacao_algoritmos_diabetes.py): `notebook/comparacao_algoritmos_diabetes.py`

### Other components

- **Experiment runner**
- **BRFSS dataset**

## Connections

- Experiment runner → Dataset download: runs experiment (evidence: `README.md`)
- Dataset download → BRFSS dataset: downloads (evidence: `README.md`)
- BRFSS dataset → Data exploration: provides records (evidence: `notebook/comparacao_algoritmos_diabetes.py`)
- Data exploration → Data preparation: examines data (evidence: `notebook/comparacao_algoritmos_diabetes.py`)
- Data preparation → Holdout split: supplies features (evidence: `notebook/comparacao_algoritmos_diabetes.py`)
- Holdout split → Preprocessing: provides training data (evidence: `notebook/comparacao_algoritmos_diabetes.py`)
- Preprocessing → SMOTE balancing: transforms training data (evidence: `README.md`)
- SMOTE balancing → KNN model: balances training data (evidence: `README.md`)
- SMOTE balancing → SVM model: balances training data (evidence: `README.md`)
- SMOTE balancing → Decision tree: balances training data (evidence: `README.md`)
- SMOTE balancing → MLP model: balances training data (evidence: `README.md`)
- KNN model → Validation comparison: predicts validation (evidence: `README.md`)
- SVM model → Validation comparison: predicts validation (evidence: `README.md`)
- Decision tree → Validation comparison: predicts validation (evidence: `README.md`)
- MLP model → Validation comparison: predicts validation (evidence: `README.md`)
- Validation comparison → SVM test evaluation: selects SVM (evidence: `README.md`)
- SVM model → SVM test evaluation: predicts test set (evidence: `notebook/comparacao_algoritmos_diabetes.py`)
- Validation comparison → Metrics and plots: reports metrics (evidence: `README.md`)
- SVM test evaluation → Metrics and plots: reports metrics (evidence: `notebook/comparacao_algoritmos_diabetes.py`)
