# amruta-katkar/predictlaptopcost. architecture

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

- Interactive diagram: https://gitdiagram.com/amruta-katkar/predictlaptopcost.
- Repository: https://github.com/amruta-katkar/predictlaptopcost.

## Overview

1. **Project purpose**
   - This repository is a small machine-learning application for **predicting laptop price** from input features.
   - It combines an **offline model-building pipeline** with a **runtime prediction UI**.

2. **Offline data preparation layer**
   - `cleane_data.csv` is the cleaned dataset used for model training.
   - `data_clean (1).ipynb` appears to be the notebook where the raw data was cleaned and transformed into a model-ready form.
   - This layer is separate from the live app and exists to produce training data and preprocessing decisions.

3. **Model training / experiment layer**
   - `model import.ipynb` is likely the notebook used to train and evaluate the regression model.
   - The repository title and files indicate a **regression-based price prediction model**.
   - The output of this layer is the serialized model artifact `LinearRegresionModel.pkl`.

4. **Serialized model artifact**
   - `LinearRegresionModel.pkl` is the persisted machine-learning model used at prediction time.
   - This file is the bridge between training and inference: the app loads it rather than retraining in production.
   - That makes the runtime lightweight and decouples the UI from the training notebooks.

5. **Application/runtime layer**
   - `programs.py` is the most likely application entry point.
   - Based on the presence of HTML templates, it likely handles:
     - receiving user input,
     - converting it into model features,
     - loading the `.pkl` model,
     - generating a predicted laptop price,
     - passing results into templates for display.
   - This is the core inference boundary of the system.

6. **Presentation layer**
   - The `templates/` directory contains the user interface pages:
     - `home.html` — landing page,
     - `laptopprice.html` — input form for laptop attributes,
     - `laptoppriceresult.html` — prediction output page.
   - These templates suggest a server-rendered web UI rather than a standalone CLI or notebook-only workflow.

7. **End-to-end data flow**
   - The flow is: **raw data → cleaned CSV → training notebook → saved model `.pkl` → runtime app → HTML result page**.
   - In production usage, only the app, model artifact, and templates are needed; the notebooks are for development/training.

8. **Subsystem boundaries**
   - **Data science boundary:** notebooks and CSV are used to clean data, engineer features, and train the model.
   - **Inference boundary:** `programs.py` loads the trained model and performs predictions.
   - **UI boundary:** HTML templates collect inputs and show results.
   - This separation keeps experimentation, model packaging, and user interaction distinct.

9. **Technology profile**
   - The repository is centered on **Python**, **pandas/numpy-style data work**, and **scikit-learn-style regression modeling** implied by the `.pkl` artifact and notebook workflow.
   - The web layer is likely a lightweight Python web framework with server-side templates, suggested by the `templates/` folder structure.

10. **Architecture characteristics**
   - The app is **file-backed and model-file-driven**, not database-driven.
   - There are no obvious external services, queues, or APIs; the whole system appears self-contained.
   - The main deployment concern is ensuring the `.pkl` model and the feature expectations in `programs.py` match the training pipeline.

11. **What to draw in an architecture diagram**
   - Show two major paths:
     - an **offline ML pipeline** from data cleaning notebook to trained model artifact,
     - an **online inference app** from user form to model prediction to rendered result.
   - The key artifact to emphasize is the **serialized regression model**, since it connects the two paths.

12. **Notable repo shape**
   - This is a compact prototype-style ML app rather than a multi-service system.
   - The architecture is simple but has a clear separation between **training-time computation** and **request-time prediction**.

Main entry points: [`programs.py`](https://github.com/amruta-katkar/predictlaptopcost./blob/main/programs.py) (Programs), [`LinearRegresionModel.pkl`](https://github.com/amruta-katkar/predictlaptopcost./blob/main/LinearRegresionModel.pkl) (Price model), [`data_clean (1).ipynb`](https://github.com/amruta-katkar/predictlaptopcost./blob/HEAD/data_clean%20(1).ipynb) (Clean notebook), [`model import.ipynb`](https://github.com/amruta-katkar/predictlaptopcost./blob/HEAD/model%20import.ipynb) (Train notebook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_offline_ml["Offline ML pipeline"]
  node_raw_data[("Cleaned data<br/>dataset<br/>[cleane_data.csv]")]
  node_cleaning_nb["Clean notebook"]
  node_training_nb["Train notebook<br/>[model import.ipynb]"]
  node_model_artifact[("Price model<br/>serialized model")]
end

subgraph group_runtime_app["Runtime app"]
  node_app_entry["Programs<br/>web app<br/>[programs.py]"]
  node_home_tpl["Home page<br/>template<br/>[home.html]"]
  node_input_tpl["Input form<br/>template<br/>[laptopprice.html]"]
  node_result_tpl["Result page<br/>template"]
end

node_raw_data -->|"prepares"| node_cleaning_nb
node_cleaning_nb -->|"feeds"| node_training_nb
node_training_nb -->|"exports"| node_model_artifact
node_model_artifact -->|"loads"| node_app_entry
node_app_entry -->|"renders"| node_home_tpl
node_app_entry -->|"renders"| node_input_tpl
node_app_entry -->|"renders"| node_result_tpl
node_input_tpl -->|"submits"| node_app_entry
node_app_entry -->|"predicts with"| node_model_artifact

click node_raw_data "https://github.com/amruta-katkar/predictlaptopcost./blob/main/cleane_data.csv"
click node_cleaning_nb "https://github.com/amruta-katkar/predictlaptopcost./blob/main/data_clean (1).ipynb"
click node_training_nb "https://github.com/amruta-katkar/predictlaptopcost./blob/main/model import.ipynb"
click node_model_artifact "https://github.com/amruta-katkar/predictlaptopcost./blob/main/LinearRegresionModel.pkl"
click node_app_entry "https://github.com/amruta-katkar/predictlaptopcost./blob/main/programs.py"
click node_home_tpl "https://github.com/amruta-katkar/predictlaptopcost./blob/main/templates/home.html"
click node_input_tpl "https://github.com/amruta-katkar/predictlaptopcost./blob/main/templates/laptopprice.html"
click node_result_tpl "https://github.com/amruta-katkar/predictlaptopcost./blob/main/templates/laptoppriceresult.html"

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_raw_data,node_cleaning_nb,node_training_nb,node_model_artifact toneBlue
class node_app_entry,node_home_tpl,node_input_tpl,node_result_tpl toneAmber
```

## Components

### Offline ML pipeline

Data cleaning and model training workflow used to produce the serialized predictor.

- [Cleaned data](https://github.com/amruta-katkar/predictlaptopcost./blob/main/cleane_data.csv): dataset · Training-ready tabular data used for model building. · `cleane_data.csv`
- [Clean notebook](https://github.com/amruta-katkar/predictlaptopcost./blob/HEAD/data_clean%20(1).ipynb): notebook · Data preparation and feature shaping workflow. · `data_clean (1).ipynb`
- [Train notebook](https://github.com/amruta-katkar/predictlaptopcost./blob/HEAD/model%20import.ipynb): notebook · Model training and evaluation experiments. · `model import.ipynb`
- [Price model](https://github.com/amruta-katkar/predictlaptopcost./blob/main/LinearRegresionModel.pkl): serialized model · Persisted regression model loaded by the app at inference time. · `LinearRegresionModel.pkl`

### Runtime app

Request-time prediction flow and server-rendered UI.

- [Programs](https://github.com/amruta-katkar/predictlaptopcost./blob/main/programs.py): web app · Main application entry point that loads the model and serves predictions. · `programs.py`
- [Home page](https://github.com/amruta-katkar/predictlaptopcost./blob/main/templates/home.html): template · Landing page for the prediction app. · `templates/home.html`
- [Input form](https://github.com/amruta-katkar/predictlaptopcost./blob/main/templates/laptopprice.html): template · Laptop feature input page. · `templates/laptopprice.html`
- [Result page](https://github.com/amruta-katkar/predictlaptopcost./blob/main/templates/laptoppriceresult.html): template · Displays the predicted laptop price. · `templates/laptoppriceresult.html`

## Connections

- Cleaned data → Clean notebook: prepares · Cleaned CSV is produced or consumed by the data preparation notebook.
- Clean notebook → Train notebook: feeds · Prepared data and feature choices flow into model training.
- Train notebook → Price model: exports · Training notebook saves the fitted regression model.
- Price model → Programs: loads · Runtime app deserializes the trained model for prediction.
- Programs → Home page: renders · Serves the landing page.
- Programs → Input form: renders · Shows the laptop input form.
- Programs → Result page: renders · Passes prediction output to the result view.
- Input form → Programs: submits · User input is sent back to the application for inference.
- Programs → Price model: predicts with · Application uses the serialized model to generate a price estimate.
