# ahmedkashima/ml_iu5-6sem architecture

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

- Interactive diagram: https://gitdiagram.com/ahmedkashima/ml_iu5-6sem
- Repository: https://github.com/ahmedkashima/ml_iu5-6sem

## Overview

##### Project type and purpose
- This is not a classic “frontend–backend” product but an educational machine-learning workbook: a collection of Jupyter notebooks, data sets, and a small standalone script (“research_in_web.py”) used to teach theory and methods of ML (regression, random forest, simple neural nets, data analysis, model evaluation).
- It serves two related use-cases:
a) Lab/exam assignments (lab1…lab6, exam, РК1, РК2) each consuming CSV data, producing analysis, plots, metrics.
b) A mini-research project (“NIRS”) consisting of a notebook and a Python script with its own requirements.txt.

##### File structure
- Top-level directories:
- lab1…lab6, exam, РК1, РК2: Each folder contains a .ipynb notebook and one or more .csv data files.
- NIRS and its copy: Both have requirements.txt, research_in_web.py, research_work.ipynb, plus raw data in data/.
- No build scripts or container configs; the environment is managed via Python/venv and Jupyter.
- A global README.md describes the course, topics, and libraries.

##### Insights from the README
- Tech stack: Python 3.11+, scikit-learn, pandas, numpy, matplotlib, seaborn, joblib.

a. Main components:
- User Interface: Jupyter Notebook server (browser interface)
- Compute Engine: Python interpreter hosting core libraries (pandas, numpy, scikit-learn, matplotlib/seaborn, joblib)
- Data Storage: Raw CSV files under each lab/experiment folder and the NIRS/data subfolder
- Research Script: research_in_web.py (CLI or notebook-imported module)
- Version Control: Git repository (contains all notebooks, data, scripts)
b. Relationships / Data flow:
1) Researcher opens Jupyter Notebook in a virtual environment →
2) Notebook loads CSV data via pandas →
3) Data flows into preprocessing code →
4) Preprocessed data passed into model training modules (scikit-learn) →
5) Models produce predictions →
6) Evaluation metrics computed (cross-validation, metrics) →
7) Visualizations rendered (matplotlib/seaborn) →
8) Optionally joblib serializes trained models to disk →
9) research_in_web.py may ingest or push data to the web or external API.
c. Architectural patterns / principles:
- Modular lab structure: each folder is a self-contained mini-pipeline.
- Reusable libraries for data loading, modeling, evaluation.
- Separation of concerns: Data → Preprocessing → Modeling → Evaluation → Visualization.
d. Key technologies:
- Python 3.11+ runtime
- Jupyter Notebook server (interactive REPL)
- pandas/numpy for data handling
- scikit-learn for ML algorithms
- matplotlib & seaborn for plots
- joblib for model persistence
- Git for source control

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Define nodes
    UI["Jupyter Notebook UI"]:::compute
    Runtime["Python Runtime (venv)"]:::compute
    DataFiles["CSV Data Files"]:::data
    Pandas["pandas / numpy"]:::ml
    Preprocessing["Preprocessing"]:::ml
    Modeling["scikit-learn Models"]:::ml
    Metrics["Evaluation Metrics"]:::ml
    Visualization["Visualization Engine\n(matplotlib / seaborn)"]:::viz
    ModelArtifacts["Model Artifacts\n(joblib)"]:::data
    ResearchScript["research_in_web.py"]:::compute
    ExternalAPI["External API"]:::external
    README["README.md"]:::doc
    GitIgnore[".gitignore"]:::doc

    %% Course Modules group
    subgraph "Course Modules"
        direction TB
        CM["Course Modules"]:::compute
        lab1["lab1.ipynb"]:::compute
        lab1d["apple_quality.csv"]:::data
        lab2["lab2.ipynb"]:::compute
        lab2d["Engineering_books_data.csv"]:::data
        lab3["lab3.ipynb"]:::compute
        lab3d["breast-cancer.csv"]:::data
        lab4["lab4.ipynb"]:::compute
        lab4d["breast-cancer.csv"]:::data
        lab5["lab5.ipynb"]:::compute
        lab5d["breast-cancer.csv"]:::data
        lab6["lab3.ipynb"]:::compute
        lab6d["breast-cancer.csv"]:::data
        exam["exam.ipynb"]:::compute
        examd1["dataset_04.csv"]:::data
        examd2["dataset_05.csv"]:::data
        rk1["RK.ipynb"]:::compute
        rk1d["googleplaystore.csv"]:::data
        rk2["RK2.ipynb"]:::compute
        rk2d["Default_Fin.csv"]:::data
    end

    %% NIRS Research group
    subgraph "NIRS Research"
        direction TB
        NIRS["NIRS Project"]:::compute
        nwip["research_work.ipynb"]:::compute
        nrw["research_in_web.py"]:::compute
        nrq["requirements.txt"]:::doc
        na1["Admission_Predict_Ver1.1.csv"]:::data
        na2["data/Admission_Predict_Ver1.1.txt"]:::data
    end

    %% NIRS Copy group
    subgraph "NIRS (Copy)"
        direction TB
        NIRC["NIRS Copy"]:::compute
        ncpw["research_work.ipynb"]:::compute
        ncw["research_in_web.py"]:::compute
        ncq["requirements.txt"]:::doc
        nca1["Admission_Predict_Ver1.1.csv"]:::data
        nca2["data/Admission_Predict_Ver1.1.txt"]:::data
    end

    %% Global docs
    subgraph "Documentation & VCS"
        direction TB
        README
        GitIgnore
    end

    %% Workflow connections
    UI --> Runtime
    Runtime --> DataFiles
    DataFiles --> Pandas
    Pandas --> Preprocessing
    Preprocessing --> Modeling
    Modeling --> Metrics
    Metrics --> Visualization
    Visualization --> UI
    Modeling --> ModelArtifacts
    ModelArtifacts --> Runtime
    nrw --> ExternalAPI

    %% Groups to workflow
    CM --> DataFiles
    NIRS --> DataFiles
    NIRC --> DataFiles

    %% Click events for component mapping
    click lab1 "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/lab1/lab1.ipynb"
    click lab1d "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/lab1/apple_quality.csv"
    click lab2 "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/lab2/lab2.ipynb"
    click lab2d "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/lab2/Engineering_books_data.csv"
    click lab3 "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/lab3/lab3.ipynb"
    click lab3d "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/lab3/breast-cancer.csv"
    click lab4 "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/lab4/lab4.ipynb"
    click lab4d "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/lab4/breast-cancer.csv"
    click lab5 "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/lab5/lab5.ipynb"
    click lab5d "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/lab5/breast-cancer.csv"
    click lab6 "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/lab6/lab3.ipynb"
    click lab6d "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/lab6/breast-cancer.csv"
    click exam "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/exam/exam.ipynb"
    click examd1 "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/exam/dataset_04.csv"
    click examd2 "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/exam/dataset_05.csv"
    click rk1 "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/РК1/RK.ipynb"
    click rk1d "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/РК1/googleplaystore.csv"
    click rk2 "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/РК2/RK2.ipynb"
    click rk2d "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/РК2/Default_Fin.csv"
    click nwip "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/NIRS/research_work.ipynb"
    click nrw "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/NIRS/research_in_web.py"
    click nrq "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/NIRS/requirements.txt"
    click na1 "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/NIRS/Admission_Predict_Ver1.1.csv"
    click na2 "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/NIRS/data/Admission_Predict_Ver1.1.txt"
    click ncpw "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/NIRS (Copy)/research_work.ipynb"
    click ncw "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/NIRS (Copy)/research_in_web.py"
    click ncq "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/NIRS (Copy)/requirements.txt"
    click nca1 "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/NIRS (Copy)/Admission_Predict_Ver1.1.csv"
    click nca2 "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/NIRS (Copy)/data/Admission_Predict_Ver1.1.txt"
    click README "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/README.md"
    click GitIgnore "https://github.com/ahmedkashima/ml_iu5-6sem/blob/main/NIRS/.gitignore"

    %% Styles
    classDef data fill:#B3CDE3,stroke:#6497B1,color:#03396C
    classDef compute fill:#C7E9B4,stroke:#78C679,color:#2C7BB6
    classDef ml fill:#FDB462,stroke:#FC8D62,color:#B2473D
    classDef viz fill:#DECBE4,stroke:#9E0142,color:#67000D
    classDef doc fill:#F0E442,stroke:#BF812D,color:#543005
    classDef external fill:#E0E0E0,stroke:#636363,color:#252525
```
