# kerolosamgad-prog/salary_prediction_program architecture

> Architecture diagram of the GitHub repository kerolosamgad-prog/salary_prediction_program, 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/kerolosamgad-prog/salary_prediction_program
- Repository: https://github.com/kerolosamgad-prog/salary_prediction_program

## Overview

##### Main Components
- Data Source: This is the CSV file (Salary_Data.csv) containing the historical salary and experience data.
- Data Processing & Model Training Component: Represented by several code artifacts (simple_linear_regression.py, Salary_prediction_model.ipynb, and simple_linear_regression.ipynb) that implement the linear regression model using scikit-learn.
- Model Persistence: The README mentions saving the trained model using Pickle. Even if the Pickle-related file isn’t explicitly visible, include a component that manages model serialization/deserialization.
- User Interface (GUI): Although the file tree does not list the GUI file (possibly main.py is implicit), the README details a Tkinter-based GUI that accepts user input, calls the prediction logic, and displays results.

##### Relationships and Data Flow
- The data flows from the CSV file to the data processing and training component. This component applies a linear regression algorithm (utilizing numpy and scikit-learn) to generate the prediction model.
- Optionally, include feedback loops from the GUI back to the model training component if the system is designed to support model re-training or live updates (this is optional based on project requirements).

##### Architectural Patterns and Design Principles
- Separation of Concerns: Clearly divide the system into data ingestion/model training and user interface layers.
- Modularization: Each component (data processing, model training, hitting model persistence, and the GUI) should be seen as a module with a clear responsibility.
- Data Flow and State Persistence: The use of Pickle for saving the trained model establishes persistence between training sessions and runtime prediction.

##### Technologies and Frameworks
- Python 3.x is the primary programming language.
- Numpy and scikit-learn serve for numerical computation and the linear regression model.
- Tkinter is used for building the GUI.
- Pickle (even if implicitly referenced) is used to serialize the trained model.

## Diagram (Mermaid)

```mermaid
flowchart TD
    DS["Data Source (Salary_Data.csv)"]:::backend
    T1["simple_linear_regression.py"]:::backend
    T2["Salary_prediction_model.ipynb"]:::backend
    T3["simple_linear_regression.ipynb"]:::backend
    MP["Model Persistence (Pickle)"]:::backend
    GUI["GUI Interface (Tkinter)"]:::frontend

    DS -->|"data_flow"| T1
    T1 -->|"data_processing"| T2
    T2 -->|"model_exploration"| T3
    T3 -->|"model_training"| MP
    MP -->|"model_load"| GUI
    GUI -->|"reload_model?"| MP

    click DS "https://github.com/kerolosamgad-prog/salary_prediction_program/blob/main/Salary_Data.csv"
    click T1 "https://github.com/kerolosamgad-prog/salary_prediction_program/blob/main/simple_linear_regression.py"
    click T2 "https://github.com/kerolosamgad-prog/salary_prediction_program/blob/main/Salary_prediction_model.ipynb"
    click T3 "https://github.com/kerolosamgad-prog/salary_prediction_program/blob/main/simple_linear_regression.ipynb"

    classDef backend fill:#add8e6,stroke:#000,stroke-width:2px;
    classDef frontend fill:#90ee90,stroke:#000,stroke-width:2px;
```
