How rohith05196/predict_housing_price works
Project type and purpose
• This is a full-stack, single-service ML web application built with Flask.
• Purpose: expose a trained regression model via a web UI so users can input housing features and receive a price prediction.
File structure
• Top level:
• app.py – Flask application (controller + routing)
• reg_predict.pickle & scalar.pickle – serialized model & preprocessor (ML artifacts)
• HousePricing.ipynb – notebook for training/EDA (offline component)
• static/ – CSS, images, client assets
• templates/ – Jinja2 HTML views
• DockerFile & Procfile – containerization & Heroku deployment
• .github/workflows/main.yaml – CI/CD pipeline
• No external database—model files live on disk and are loaded at runtime.
README for additional insights
• Confirms Flask + Jinja frontend, pickled model, Docker/Heroku support.
• No mention of a database or external API dependencies.
a. Main components
1) User Browser (UI)
2) Flask Web Server (app.py)
3) Static Assets & Templates (static/, templates/)
4) ML Model Service
– Preprocessor (scalar.pickle)
– Regression Model (reg_predict.pickle)
5) Offline Training Notebook (HousePricing.ipynb)
6) CI/CD Pipeline (GitHub Actions workflow)
7) Container/Hosting (Docker image, Heroku dyno)
b. Relationships and interactions
• Browser → HTTP Request → Flask App
• Flask App loads scalar.pickle → preprocess input
• Flask App loads reg_predict.pickle → predict price
• Flask App renders output via templates to Browser
• DockerFile builds container bundling app + pickles + static/templates
• GitHub Actions triggers on push → builds Docker image → (optional) deploy to Heroku
• Notebook remains a separate offline step (train/update model → regenerate pickles)
c. Architectural patterns/design principles
• MVC‐like separation:
• Model: pickled artifacts
• View: Jinja templates + static assets
• Controller: Flask routes in app.py
• Single container microservice pattern—no external DB
• CI/CD via GitHub Actions for build & test
d. Key technologies/frameworks/libraries
• Flask (Python web framework)
• Jinja2 (templating engine)
• scikit-learn (model serialization)
• pickle (artifact storage)
• Docker (containerization)
• Heroku (PaaS hosting)
• GitHub Actions (CI/CD)
Detail and component breakdown
• Route handler for “/” (renders input form)
• Route handler for “/predict” (processes POST, calls predict)
• Static file handler
• Folders under Flask App: templates/, static/
• Environment (virtualenv, dependencies from requirements.txt)
• Port mappings (5000 local, 80/443 on Heroku)