How saipavankumar22/aluminiml works
Project Type and Purpose
• This is a full-stack Python/Flask web application embedding a machine-learning component.
• Purpose: accept casting parameters via a web form, run three pre-trained scikit-learn regression models (UTS, elongation, conductivity), and return predictions in real time.
File-Structure Analysis
• Top level:
• app.py – Flask application entry point (controllers/routes).
• AluminiumBilletPropertiesPrediction.ipynb – Jupyter notebook used to explore data and build/train models.
• aluminium dataset.xlsx – raw data for model training.
• models/ – serialized model objects (.pkl).
• templates/ – Flask Jinja2 HTML views (alu.html, login & signup pages).
• static/ – CSS/JS assets.
• No external database—state is ephemeral, models live on disk.
• MVC-style separation: templates (View), app.py routes (Controller), pickled models (Model).
Key Insights from README
• Stack: Python, Flask, scikit-learn, HTML/CSS/JS.
• Input parameters: casting temp, cooling temp, casting speed, bar entry temp, emulsion temp/pressure/concentration, quench pressure.
• Output: UTS, elongation, conductivity.
Components
a. User Interface Layer
– Web Browser (HTML form in alu.html)
– Static Assets (CSS/JS) served from /static
b. Application Layer
– Flask App (app.py)
• HTTP endpoints:
• GET / → render input form
• POST /predict → parse form data, call ModelService
– Controller / Router logic
c. Machine-Learning Layer
– ModelService
• Loads .pkl files from models/
• Uses scikit-learn to run .predict()
d. Data & Storage
– Model Files on filesystem (models/*.pkl)
– (Offline) Data source: aluminium dataset.xlsx + Jupyter notebook pipeline
e. External Dependencies
– scikit-learn library
– Flask framework
Relationships & Data Flow
1. User fills form → Browser sends HTTP POST to Flask
2. Flask Route invokes ModelService → loads required .pkl model
3. ModelService returns prediction values
4. Flask renders alu.html with predictions embedded
5. Browser displays results
Architectural Patterns & Principles
• MVC Pattern: clear separation of views (templates), controllers (Flask routes), models (ML artifacts).
• Layered Architecture: UI → Application → ML → Persistence.
• Single-process, lightweight microservice-style Flask app.
• Configuration-as-code: models loaded by path, no external config server.
Technologies & Frameworks
• Flask (web server & routing)
• Jinja2 (templating engine)
• scikit-learn (ML inference)
• Python 3.x
• HTML/CSS/JavaScript (frontend)