# yankibtw/pneumania_detection_ml architecture

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

- Interactive diagram: https://gitdiagram.com/yankibtw/pneumania_detection_ml
- Repository: https://github.com/yankibtw/pneumania_detection_ml

## Overview

This repository is a collection of standalone chest-X-ray pneumonia classification experiments, not a shared application: scripts download the Kaggle dataset, process images, and report classification results. The feature-engineering experiments extract image features, select subsets, and compare classifiers; separate scripts test compression-based classification. Source excerpts are partial, so connections between independent scripts are shown only where their own code supports them.

Main entry points: [`finaly.py`](https://github.com/yankibtw/pneumania_detection_ml/blob/main/finaly.py) (Model comparison), [`methods/KNN.py`](https://github.com/yankibtw/pneumania_detection_ml/blob/main/methods/KNN.py) (KNN experiment), [`methods/LR.py`](https://github.com/yankibtw/pneumania_detection_ml/blob/main/methods/LR.py) (Logistic regression), [`methods/NB.py`](https://github.com/yankibtw/pneumania_detection_ml/blob/main/methods/NB.py) (Naive Bayes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_features["Feature experiments"]
  node_finaly["Model comparison<br/>[finaly.py]"]
  node_feature_extract["Image features<br/>[finaly.py]"]
  node_feature_select["Feature selection<br/>[finaly.py]"]
end

subgraph group_models["Classifiers"]
  node_knn["KNN experiment<br/>[KNN.py]"]
  node_lr["Logistic regression<br/>[LR.py]"]
  node_nb["Naive Bayes<br/>[NB.py]"]
  node_rf["Random forest<br/>[RF.py]"]
  node_svm["SVM experiment<br/>[SVM.py]"]
  node_xboost["Gradient boosting<br/>[XBoosting.py]"]
end

subgraph group_compression["Compression experiments"]
  node_ncd["NCD classifier<br/>[KOL.py]"]
  node_dictionary["Dictionary classifier<br/>[KOL_1.py]"]
end

node_user(("Experiment runner"))
node_dataset[("Kaggle X-ray dataset")]

node_user -->|"runs"| node_finaly
node_dataset -->|"downloads"| node_finaly
node_finaly -->|"extracts features"| node_feature_extract
node_finaly -->|"selects features"| node_feature_select
node_user -->|"runs"| node_knn
node_dataset -->|"downloads"| node_knn
node_user -->|"runs"| node_lr
node_dataset -->|"downloads"| node_lr
node_user -->|"runs"| node_nb
node_dataset -->|"downloads"| node_nb
node_user -->|"runs"| node_rf
node_dataset -->|"downloads"| node_rf
node_user -->|"runs"| node_svm
node_dataset -->|"downloads"| node_svm
node_user -->|"runs"| node_xboost
node_dataset -->|"downloads"| node_xboost
node_user -->|"runs"| node_ncd
node_dataset -->|"downloads"| node_ncd
node_user -->|"runs"| node_dictionary
node_dataset -->|"downloads"| node_dictionary

click node_finaly "https://github.com/yankibtw/pneumania_detection_ml/blob/main/finaly.py"
click node_feature_extract "https://github.com/yankibtw/pneumania_detection_ml/blob/main/finaly.py"
click node_feature_select "https://github.com/yankibtw/pneumania_detection_ml/blob/main/finaly.py"
click node_knn "https://github.com/yankibtw/pneumania_detection_ml/blob/main/methods/KNN.py"
click node_lr "https://github.com/yankibtw/pneumania_detection_ml/blob/main/methods/LR.py"
click node_nb "https://github.com/yankibtw/pneumania_detection_ml/blob/main/methods/NB.py"
click node_rf "https://github.com/yankibtw/pneumania_detection_ml/blob/main/methods/RF.py"
click node_svm "https://github.com/yankibtw/pneumania_detection_ml/blob/main/methods/SVM.py"
click node_xboost "https://github.com/yankibtw/pneumania_detection_ml/blob/main/methods/XBoosting.py"
click node_ncd "https://github.com/yankibtw/pneumania_detection_ml/blob/main/KOL.py"
click node_dictionary "https://github.com/yankibtw/pneumania_detection_ml/blob/main/KOL_1.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_finaly,node_feature_extract,node_feature_select toneBlue
class node_knn,node_lr,node_nb,node_rf,node_svm,node_xboost,node_dataset toneAmber
class node_ncd,node_dictionary toneMint
class node_user toneIndigo
```

## Components

### Feature experiments

- [Model comparison](https://github.com/yankibtw/pneumania_detection_ml/blob/main/finaly.py): `finaly.py`
- [Image features](https://github.com/yankibtw/pneumania_detection_ml/blob/main/finaly.py): `finaly.py`
- [Feature selection](https://github.com/yankibtw/pneumania_detection_ml/blob/main/finaly.py): `finaly.py`

### Classifiers

- [KNN experiment](https://github.com/yankibtw/pneumania_detection_ml/blob/main/methods/KNN.py): `methods/KNN.py`
- [Logistic regression](https://github.com/yankibtw/pneumania_detection_ml/blob/main/methods/LR.py): `methods/LR.py`
- [Naive Bayes](https://github.com/yankibtw/pneumania_detection_ml/blob/main/methods/NB.py): `methods/NB.py`
- [Random forest](https://github.com/yankibtw/pneumania_detection_ml/blob/main/methods/RF.py): `methods/RF.py`
- [SVM experiment](https://github.com/yankibtw/pneumania_detection_ml/blob/main/methods/SVM.py): `methods/SVM.py`
- [Gradient boosting](https://github.com/yankibtw/pneumania_detection_ml/blob/main/methods/XBoosting.py): `methods/XBoosting.py`

### Compression experiments

- [NCD classifier](https://github.com/yankibtw/pneumania_detection_ml/blob/main/KOL.py): `KOL.py`
- [Dictionary classifier](https://github.com/yankibtw/pneumania_detection_ml/blob/main/KOL_1.py): `KOL_1.py`

### Other components

- **Experiment runner**
- **Kaggle X-ray dataset**

## Connections

- Experiment runner → Model comparison: runs (evidence: `finaly.py`)
- Kaggle X-ray dataset → Model comparison: downloads (evidence: `finaly.py`)
- Model comparison → Image features: extracts features (evidence: `finaly.py`)
- Model comparison → Feature selection: selects features (evidence: `finaly.py`)
- Experiment runner → KNN experiment: runs (evidence: `methods/KNN.py`)
- Kaggle X-ray dataset → KNN experiment: downloads (evidence: `methods/KNN.py`)
- Experiment runner → Logistic regression: runs (evidence: `methods/LR.py`)
- Kaggle X-ray dataset → Logistic regression: downloads (evidence: `methods/LR.py`)
- Experiment runner → Naive Bayes: runs (evidence: `methods/NB.py`)
- Kaggle X-ray dataset → Naive Bayes: downloads (evidence: `methods/NB.py`)
- Experiment runner → Random forest: runs (evidence: `methods/RF.py`)
- Kaggle X-ray dataset → Random forest: downloads (evidence: `methods/RF.py`)
- Experiment runner → SVM experiment: runs (evidence: `methods/SVM.py`)
- Kaggle X-ray dataset → SVM experiment: downloads (evidence: `methods/SVM.py`)
- Experiment runner → Gradient boosting: runs (evidence: `methods/XBoosting.py`)
- Kaggle X-ray dataset → Gradient boosting: downloads (evidence: `methods/XBoosting.py`)
- Experiment runner → NCD classifier: runs (evidence: `KOL.py`)
- Kaggle X-ray dataset → NCD classifier: downloads (evidence: `KOL.py`)
- Experiment runner → Dictionary classifier: runs (evidence: `KOL_1.py`)
- Kaggle X-ray dataset → Dictionary classifier: downloads (evidence: `KOL_1.py`)
