How madhav-73/disease-prediction-and-drug-recommendation works
Project type and purpose
• This is a machine-learning-based prediction service: it takes patient symptom data (and possibly processed drug-review text), runs a trained model, and returns both a disease prediction and a set of recommended drugs.
• The presence of Jupyter notebooks (“Disease_condition_detection_drug_reviews.ipynb” and “disease-condition-prediction.ipynb”) indicates an offline/experimental pipeline; “app.py” plus two pickle files (passmodel.pkl and tfidfvectorizer.pkl) form the runtime inference service.
File structure
• Top level:
• README.md – project overview and features
• app.py – inference service entry point (likely a Flask/FastAPI/CLI wrapper around the model)
• passmodel.pkl – trained classification model
• tfidfvectorizer.pkl – text vectorizer for feature extraction
• .ipynb_checkpoints – intermediate notebook checkpoints (iterative development, not part of production)
• No separate “frontend” or “backend” directories → single service architecture
README for additional insights
• Confirms two main capabilities: disease prediction and drug recommendation.
• Mentions “modular structure,” but in fact the codebase is compact: offline notebooks (development) vs. a standalone inference app.
a. Main components
1. User Interface (UI) or Client
‑ Could be a web UI, REST client, or CLI (not part of repo but assumed)
2. Inference Service (app.py)
‑ HTTP/CLI endpoint that accepts input (symptoms, optional text)
‑ Orchestrates preprocessing, model loading, postprocessing
3. Preprocessing Module
‑ Uses tfidfvectorizer.pkl to transform raw text/symptoms into feature vectors
4. Predictive Model
‑ passmodel.pkl to predict disease labels
5. Recommendation Engine
‑ Maps predicted disease to top-3 drug recommendations (likely internal lookup)
6. (Offline) Experimentation Pipeline
‑ Jupyter notebooks: data ingestion → feature engineering → model training → serialization
7. External Dependencies
‑ scikit-learn, pandas, Flask/FastAPI (or whichever web framework), numpy
b. Relationships & interactions
• Client sends request → Inference Service
• Inference Service loads vectorizer → transforms input → passes features to Model
• Model outputs disease label → Recommendation Engine selects drugs → Service returns response
• Offline notebooks connect to raw datasets, produce serializations used by the service
c. Architectural patterns / design principles
• Separation of concerns:
• Offline training vs. online serving
• Preprocessing, inference, and recommendation as distinct modules
• Model serialization for decoupling training from serving
• Stateless service: no persistent storage; all state is in model files
d. Key technologies
• Python 3.x
• scikit-learn (model training & inference)
• pickle (model/vectorizer serialization)
• Flask or FastAPI (app.py likely)
• Jupyter (notebooks)
Elements
• Client → Service request
• Service → Vectorizer → Model → Recommender → Service response → Client
• Notebooks → create .pkl artifacts → Service
• Blue for runtime components
• Gray for offline/training components
• Green for external libraries/dependencies