# charans2702/placement_prediction_using_machine-learning architecture

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

- Interactive diagram: https://gitdiagram.com/charans2702/placement_prediction_using_machine-learning
- Repository: https://github.com/charans2702/placement_prediction_using_machine-learning

## Overview

##### Main Components
- Data Sources: The CSV files (Placement_prediction_data.csv and salary_prediction_data.csv) containing student data used for training and evaluation.
- Data Preprocessing: Represented by the Jupyter Notebook preprocessing.ipynb which outlines steps such as handling missing values, encoding, scaling, and feature selection.
- Model Training Components: Two training scripts (Placement_Prediction.py and salary_prediction.py) that use Random Forest classifiers to train the placement and salary prediction models. Also include the resulting model artifacts (model.pkl and model1.pkl).
- Web Application (Flask App): The app.py file serves as the main entry point for the Flask application handling user requests. It loads the pre-trained models and provides endpoints for inputting student data and delivering predictions.
- Frontend/UI: The “templates” directory contains HTML files that define the user interface (home, about, index, output), and the “static” folder holds CSS files and images (like plots and confusion matrices) which are used to display the results and system visuals.
- Dependencies/Configuration: The requirements.txt file lists the necessary third-party packages.

##### Relationships and Interactions
- Users interact with the web interface (HTML pages from the templates folder), using a browser which sends HTTP requests to the Flask backend (app.py).
- The Flask app processes incoming inputs and dispatches requests to the appropriate prediction function that loads one of the pre-trained models (using model.pkl for placement prediction and model1.pkl for salary prediction).
- The data flow moves from the user input -> Flask routes -> ML model prediction logic -> results rendering in HTML.
- The static assets (CSS, images) are used to enhance user experience and display evaluation metrics or output visualizations (e.g., confusion matrix, ROC curve).
- The initial machine learning pipeline (data preprocessing and model training) is generally a one-time process documented through the Jupyter Notebook and training scripts, which then results in the static model pickle files used during deployment.

##### Architectural Patterns and Design Principles
- Separation of Concerns: The project clearly divides the responsibilities by having separate directories for static assets (UI), templates (views), and core logic in app.py. The training code (separate .py files and the notebook) is decoupled from the deployment code.
- Modular Design: Training and inference are modular. The ML models are trained separately and then loaded in the Flask application, ensuring that the prediction logic is separated from the data preprocessing and training phases.
- Use of Standard Frameworks: Flask is used for rapid web application development and integration of ML predictions, while Random Forest classifiers from libraries such as scikit-learn are employed for predictive modeling.

##### Relevant Technologies, Frameworks, or Libraries
- Flask for the web framework.
- scikit-learn for building the Random Forest models.
- Python as the programming language.
- Jupyter Notebook for data preprocessing and exploratory data analysis.
- Basic HTML/CSS for front-end design with templates and static assets.

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "Data Pipeline"
        subgraph "Data Sources"
            A["Placement_Prediction_data.csv"]:::data
            B["Salary_prediction_data.csv"]:::data
        end
        C["Data Preprocessing: preprocessing.ipynb"]:::processing
        subgraph "Model Training"
            D["Training Script: Placement_Prediction.py"]:::training
            E["Training Script: Salary_prediction.py"]:::training
            F["ML Model: model.pkl"]:::model
            G["ML Model: model1.pkl"]:::model
        end
    end
    U["User (Browser)"]:::frontend
    H["Flask App: app.py"]:::backend
    subgraph "Frontend/UI"
        subgraph "Templates"
            T1["templates/about.html"]:::frontend
            T2["templates/home.html"]:::frontend
            T3["templates/index.html"]:::frontend
            T4["templates/output.html"]:::frontend
        end
        subgraph "Static Assets"
            S1["static/css/style.css"]:::frontend
            S2["static/css/style1.css"]:::frontend
            S3["static/css/style2.css"]:::frontend
            S4["static/css/style3.css"]:::frontend
            S5["static/images"]:::frontend
        end
    end
    J["Dependencies: requirements.txt"]:::dep

    %% Connections for Data Pipeline
    A --> C
    B --> C
    C --> D
    C --> E
    D --> F
    E --> G
    F --> H
    G --> H

    %% User interactions and Deployment Flow
    U --> H
    H --> T1
    H --> S1
    J --> H

    %% Class Definitions for Styling
    classDef data fill:#f9e79f,stroke:#d35400,stroke-width:2px;
    classDef processing fill:#aed6f1,stroke:#2471a3,stroke-width:2px;
    classDef training fill:#a9dfbf,stroke:#229954,stroke-width:2px;
    classDef model fill:#f5b7b1,stroke:#c0392b,stroke-width:2px;
    classDef backend fill:#d2b4de,stroke:#7d3c98,stroke-width:2px;
    classDef frontend fill:#fcf3cf,stroke:#d4ac0d,stroke-width:2px;
    classDef dep fill:#e8daef,stroke:#8e44ad,stroke-width:2px;

click A "https://github.com/charans2702/placement_prediction_using_machine-learning/blob/master/Placement_Prediction_data.csv"
click B "https://github.com/charans2702/placement_prediction_using_machine-learning/blob/master/Salary_prediction_data.csv"
click C "https://github.com/charans2702/placement_prediction_using_machine-learning/blob/master/preprocessing.ipynb"
click D "https://github.com/charans2702/placement_prediction_using_machine-learning/blob/master/Placement_Prediction.py"
click E "https://github.com/charans2702/placement_prediction_using_machine-learning/blob/master/Salary_prediction.py"
click F "https://github.com/charans2702/placement_prediction_using_machine-learning/blob/master/model.pkl"
click G "https://github.com/charans2702/placement_prediction_using_machine-learning/blob/master/model1.pkl"
click H "https://github.com/charans2702/placement_prediction_using_machine-learning/blob/master/app.py"
click T1 "https://github.com/charans2702/placement_prediction_using_machine-learning/blob/master/templates/about.html"
click T2 "https://github.com/charans2702/placement_prediction_using_machine-learning/blob/master/templates/home.html"
click T3 "https://github.com/charans2702/placement_prediction_using_machine-learning/blob/master/templates/index.html"
click T4 "https://github.com/charans2702/placement_prediction_using_machine-learning/blob/master/templates/output.html"
click S1 "https://github.com/charans2702/placement_prediction_using_machine-learning/blob/master/static/css/style.css"
click S2 "https://github.com/charans2702/placement_prediction_using_machine-learning/blob/master/static/css/style1.css"
click S3 "https://github.com/charans2702/placement_prediction_using_machine-learning/blob/master/static/css/style2.css"
click S4 "https://github.com/charans2702/placement_prediction_using_machine-learning/blob/master/static/css/style3.css"
click S5 "https://github.com/charans2702/placement_prediction_using_machine-learning/tree/master/static/images"
click J "https://github.com/charans2702/placement_prediction_using_machine-learning/blob/master/requirements.txt"
```
