AyurHealth is a small Flask web app that:
- Predicts a probable disease from 4 user-entered symptoms using ML
- Suggests Ayurvedic remedies for a selected condition from a curated CSV
- Provides a simple, responsive UI (Bootstrap + custom CSS)
- The Symptoms page posts four symptoms to the backend.
- The backend trains multiple classifiers on
Training.csv(RandomForest, SVC, LogisticRegression, GaussianNB), evaluates them onTesting.csvand selects the model with the best accuracy for prediction. - The predicted disease is displayed and also stored in a local SQLite DB.
- The Suggester page looks up
Remedies.csvand displays the matching row.
Prerequisites: Python 3.10+ recommended
python -m venv .venv
.venv\Scripts\activate # Windows
source .venv/bin/activate # macOS/Linuxpip install -r requirements.txtpython AyurHealth.pyNavigate to: http://localhost:3000
- Home → Overview and quick links
- Symptoms → Enter four symptoms (pretty labels), get ML prediction
- Suggester → Select a condition and view remedies from CSV
- About → About page
-
AyurHealth.py- Flask application entry point and routes:
/→ Home/symptoms→ Symptoms page (GET)/suggester→ Suggester page (GET)/about→ About page (GET)/s1(POST) → Handles symptoms form, predicts disease and renders result/s2(POST) → Handles suggester form and renders remedies
- The server runs on host
'localhost', port3000(debug=True)
- Flask application entry point and routes:
-
Symptom.py- ML workflow for disease prediction:
- Loads
Training.csv/Testing.csv - Encodes prognosis labels to integers
- Trains candidate models: RandomForest, SVC, LogisticRegression, GaussianNB
- Evaluates on
Testing.csv, selects the best by accuracy - Builds a feature vector from the four symptoms and predicts with the best model
- Logs model accuracies and chosen model
- Saves each prediction into SQLite (
database.db→ tableSymptomPrediction)
- Loads
- ML workflow for disease prediction:
-
Suggester.py- Simple CSV lookup for remedies. Finds the row in
Remedies.csvwhose first cell matches the chosen condition and returns the formatted content.
- Simple CSV lookup for remedies. Finds the row in
templates/index.html→ Home (navbar includes Symptoms and Suggester)templates/symptoms.html→ Symptoms form + prediction resulttemplates/suggester.html→ Remedies lookup + resulttemplates/about.html→ Static info page
static/css/project.css→ Custom styles and responsive rulesbootstrap.min.css→ Bootstrap framework
static/js/slide.js→ Home page image slideshow (only runs on Home)symptoms.js→ Hides previous prediction when user edits inputssuggester.js→ Page-specific JS for suggester (if any hooks)
static/images/→ App images and icons
Training.csv→ Training data with symptom columns and a prognosis columnTesting.csv→ Test set used for accuracy selectionRemedies.csv→ Conditions and corresponding remedy text
-
database.db- Local SQLite DB created at runtime; stores symptom inputs and predictions
- Ignored by Git via
.gitignore
-
requirements.txt- Minimal dependencies to run the app (Flask, pandas, scikit-learn)
- If your platform needs it, install numpy/scipy as well (pip will usually resolve)
-
start.sh- Simple one-line runner used for Glitch/hosting scenarios
-
.gitignore- Excludes caches, virtualenvs, databases, build outputs and editor files
- Symptoms inputs show human-friendly labels (e.g., “Back Pain”) but the backend receives machine codes (e.g., back_pain) so the model works consistently.
- After submitting Symptoms/Suggester, the page anchors to the result box.
- When the user focuses/types again in Symptoms inputs, the previous result box is hidden to avoid confusion.
- Accuracy is selected on a small
Testing.csv(43 rows), so different models can tie. The project logs per-model accuracies and the selected model each request. - For stronger validation, consider k-fold cross-validation on
Training.csvand usingTesting.csvstrictly for a final holdout check.