How omkar4965/ipl-win-predictor works
Project type and purpose
• This is a full‑stack web application (single‑page, server‑driven UI) built with Streamlit that hosts a pre‑trained Scikit‑learn model.
• Purpose: Allow users to input live IPL match conditions and get a real‑time probability of a team winning.
File structure
• Top level:
– app.py → Streamlit entry point and combined frontend/backend logic
– pipe.pkl → Serialized ML pipeline (preprocessing + model)
– requirements.txt → Python dependencies (Streamlit, scikit‑learn, pandas, etc.)
– README.md, LICENSE, .idea (IDE config)
• No separate frontend or backend directory: UI and inference logic are colocated in app.py.
• Deployment: Render (PaaS) is mentioned in README, indicating an external cloud host.
Extract architecture insights from README
• Frontend: Streamlit widgets for team, city, current match state
• Backend: Python code in app.py does feature engineering (runs left, balls left, CRR, RRR) then calls pipe.pkl
• Model: Scikit‑learn pipeline loaded from pipe.pkl
• Deployment: App runs on Render; external users connect via HTTPS
Main components
a. Client (Browser)
b. Streamlit Server (app.py)
c. Python Runtime & Dependencies
d. ML Pipeline (pipe.pkl)
e. Data Processing Modules (feature calculation)
f. Render Hosting Platform
g. (Optional) External Data Source for future “live match data”
Relationships & data flow
1. User opens URL → HTTPS request to Render
2. Render routes request to Streamlit process
3. Streamlit renders UI widgets in browser
4. User input → HTTP POST back to Streamlit
5. app.py computes derived features
6. app.py loads pipe.pkl → model.predict_proba
7. app.py returns probabilities to UI
8. Browser displays results
Architectural patterns & design principles
• Single process handles both presentation and business logic (Streamlit’s model)
• Pre‑trained ML pipeline decouples training from inference
• Stateless request handling: each user interaction recomputes from scratch
• Future extension: Microservice or data ingestion layer for live data
Technologies & frameworks
• Python 3.x, Streamlit (frontend + HTTP server)
• Scikit‑learn pipeline serialized in pipe.pkl
• pandas / numpy for data manipulation
• Render.com PaaS for continuous deployment
• requirements.txt for reproducible environment
Additional detail to capture
• In‑memory feature computation module inside app.py
• That there is no external database at present (state is ephemeral)
• Future extension point: “Live Match Data API” or “Data Ingestion Service”
Summary of what
• Components: Browser Client, Streamlit Server, Python Runtime (+ libs), ML Pipeline (pipe.pkl), Render Hosting
• Data flows: user input → feature calc → model inference → UI output