How riddhimanpuzari-88/maternal_risk_detector works
1. What this repo is
- This is a small Python machine-learning inference app for maternal risk detection.
- The public deployment is a Streamlit app, so the repository is likely focused on serving predictions, not on training a model in production.
2. Primary runtime entry point
- app.py is the main application file.
- Architecturally, this is the presentation + inference layer: it likely builds the UI, collects user inputs, prepares a feature vector, and calls the trained model to produce a risk prediction.
3. Model artifact boundary
- model.joblib is the serialized trained model.
- This file represents the core prediction engine and is separated from the app code, which means the repo cleanly divides model serving from model training.
4. Feature schema artifact
- feature_names.joblib is a second serialized artifact used to keep the input schema consistent.
- Its presence suggests the app must match user-entered values to the exact feature order/names expected by the model, which is important for reliable inference.
5. Data source / training context
- Dataset - Updated.csv is most likely the dataset used for training, validation, or analysis.
- It is probably not required for runtime predictions unless the app includes exploratory display or retraining logic, but it is part of the repository’s model-development lineage.
6. Request-to-prediction flow
- A user opens the Streamlit app.
- app.py renders input controls for maternal-health-related attributes.
- The app maps those inputs into the model’s expected feature set using feature_names.joblib.
- The prepared data is passed into model.joblib.
- The model returns a risk class or score, which Streamlit displays in the UI.
7. System boundaries
- There is no sign of a separate backend service, database, message queue, or API layer.
- The architecture appears to be a single-process app: UI and inference live together in one Python runtime.
8. Deployment model
- The README links to a Streamlit Cloud deployment, so the app is meant to be hosted as a lightweight interactive ML demo.
- That deployment style reinforces that the repo is intended for direct browser interaction with a local model artifact, not remote model serving.
9. Dependency stack
- requirements.txt likely pins Streamlit and ML/data libraries such as pandas, numpy, and joblib/scikit-learn.
- These dependencies shape the architecture as a Python notebook-to-app style ML project rather than a full backend/frontend split.
10. Practical diagram takeaway
- The main boxes to draw are:
- Browser / user
- Streamlit app (app.py)
- Serialized model (model.joblib)
- Feature schema (feature_names.joblib)
- Dataset artifact (Dataset - Updated.csv) as the training source
- The dominant flow is user input → feature alignment → model inference → displayed risk result.
11. Repository character
- This is best described as a model-serving repository with bundled artifacts, not a platform.
- The important architectural idea is that the trained model and its feature contract are versioned alongside the app to keep prediction behavior stable.
Main entry points: app.py Streamlit app · Dataset - Updated.csv Dataset · feature_names.joblib Feature schema · model.joblib Risk model
Components 6
Runtime
Interactive inference path for the deployed Streamlit app.
- User · Person using the Streamlit demo to enter maternal health inputs.
- Streamlit app · Main application entrypoint that renders inputs and coordinates prediction.
app.py - Python deps · Dependency set for Streamlit and the ML/data stack used by the app.
requirements.txt
Artifacts
Versioned model and schema artifacts used at prediction time.
- Feature schema · Serialized feature-name order used to align user input with the model contract.
feature_names.joblib - Risk model · Serialized trained classifier used to produce the maternal risk prediction.
model.joblib
Data lineage
Training data source that informs the bundled artifacts.
- Dataset · CSV dataset likely used for training or validation of the bundled model.
Dataset - Updated.csv
Connections 6
- User → Streamlit app: enters inputs · The user interacts with the Streamlit interface to provide maternal-health attributes.
- Streamlit app → Feature schema: aligns features · The app maps form values into the exact feature order expected by the model.
- Streamlit app → Risk model: loads model · The app invokes the serialized predictor to generate a risk result.
- Dataset → Risk model: trains/validates · The dataset is the likely source used to build the bundled model artifact.
- Dataset → Feature schema: defines schema · The dataset likely established the feature names and ordering preserved in the schema artifact.
- Python deps → Streamlit app: supports runtime · Dependencies provide the web UI and numerical/model-serving libraries used by the app.