How maazuddin1/banglore_realestate_forecast-using-cicd-piplines works
Project Type and Purpose
• This is a full-stack, machine-learning-powered web application.
• It exposes a Flask-based frontend for user interactions and a backend ML service for price predictions.
File Structure
• Top-Level
– app.py: Flask app entry point and route definitions
– main.py: CLI or alternative execution script
– setup.py & requirements.txt: packaging and dependency management
– .github/workflows/python-app.yml: CI/CD pipeline
• Data & Models
– data/bengaluru_house_prices.csv: raw dataset (used offline in notebooks)
– models/*.pkl: serialized feature names and trained regression model
• Source Code (src/)
– preprocessing.py: data cleaning, feature engineering, one-hot encoding
– model.py: model training, evaluation, loading logic
– EDA.py: exploratory data analysis (offline, batch)
• Templates
– templates/index.html: user input form
– templates/results.html: prediction display
• Tests
– tests/: unit tests for model and API integration
Gather Insights from the README
• Core flow: User → Flask App → Preprocessing → ML Model → Prediction → UI
• Exposed endpoint: POST /predict returns JSON with predicted price
• CI/CD: runs tests, lints, and deploys via GitHub Actions
Main Components
a. User Interface (Browser)
b. Flask Application Layer
c. Preprocessing Module
d. ML Inference Module (loads lr_regg.pkl & feature_names.pkl)
e. Data Stores
– Raw Data (CSV file, used offline)
– Model Artifacts (Pickle files)
f. CI/CD Pipeline (GitHub Actions)
Relationships and Data Flow
1. User fills form in Browser → HTTP POST to /predict on Flask App
2. Flask App dispatches to preprocessing.py → transforms inputs into feature vector
3. Preprocessing output passed to model.py → loads pickled model → inference
4. Prediction returned to Flask App → renders results.html or JSON response
5. (Offline) EDA.py and model.py used during training stage with data CSV → produce new .pkl files
Architectural Patterns & Design Principles
• Separation of concerns: UI / routing (app.py) vs. data processing vs. model inference
• Modularity: src/ holds reusable components; templates/ holds presentation logic
• Test-driven: tests/ ensures model correctness and API stability
• CI/CD: automated testing and deployment via GitHub Actions
Relevant Technologies & Frameworks
• Flask (web framework)
• scikit-learn (LinearRegression, pickling)
• Jinja2 (templating engine)
• GitHub Actions (CI/CD)
• Python packaging (setup.py, requirements.txt)
Essential Elements to Capture
• Clear component labels
• Distinction between online inference path and offline training pipeline
• CI/CD pipeline integration (trigger → test → deploy)