How shaadclt/multiple-disease-prediction-system works
Project type and purpose
• This is a single-page, Streamlit-based web application written in Python.
• Purpose: allow end users to enter medical parameters in a browser UI and receive predictions for diabetes, heart disease, and Parkinson’s disease via pre-trained machine-learning models.
File structure
• Top-level files:
• Three Jupyter notebooks (“Multiple Disease Prediction System – …ipynb”) used for model development and exploration.
• multiplediseaseprediction.py: the Streamlit application entry point that ties together UI, model loading, prediction logic, and visualization.
• Three .csv files (datasets) and three .sav files (persisted, pre-trained scikit-learn models).
• requirements.txt: defines Python dependencies (Streamlit, pandas, scikit-learn, etc.).
• No separate “frontend” vs. “backend” directories; the Streamlit script serves both roles.
• No external databases—data assets and models are file-based.
README for additional insights
• Confirms tech stack: Python + Streamlit + scikit-learn.
• Workflow: user input → prediction → visualization.
• No distributed services or microservices; everything is co-located in one runtime.
Main components and their interactions
a. User / Client (web browser)
b. Streamlit App Server (multiplediseaseprediction.py)
• UI Layer: form inputs, buttons, result panes
• Controller/Orchestration: routes input to preprocessing, model inference, and visualization functions
c. Preprocessing Module: reads form values, sanitizes/normalizes features for each disease model
d. Model Loader & Inference Module: loads .sav files for diabetes, heart, Parkinson’s and invokes .predict_proba() or .predict()
e. Visualization Module: generates charts (e.g., feature-importance bar charts)
f. Data Assets: CSV files (for reference or retraining), Model files (.sav)
Relationships:
• Browser → HTTP request (Streamlit) → App Server
• App Server → Preprocessing → Model Inference → Visualization → App Server → Browser
• App Server ↔ File System (load .sav models and optional CSVs)
Architectural patterns and design principles
• Monolithic single-process architecture (UI and business logic co-located)
• Separation of concerns within the script: UI, preprocessing, inference, visualization
• Offline training pipeline (represented by Jupyter notebooks) decoupled from the runtime system
Detail without over-fragmenting
• Logical sub-component (UI form, inference engine, file loader, chart generator)
• Avoid needless micro-services; reflect the true monolithic nature
• External dependencies (Python runtime, Streamlit framework)