This system provides AI-powered medical risk assessment using supervised machine learning. It analyzes patient data to predict overall risk levels and disease probabilities with explainable recommendations.
- Risk Classification: Predicts Low/Medium/High risk levels
- Risk Regression: Calculates disease risk percentage (0-100%)
- Feature Engineering: Medical logic-based feature extraction
- Explainable AI: Provides reasoning for predictions
- Web Interface: Simple HTML/CSS/JS frontend
- FastAPI Backend: RESTful API with validation
pip install -r requirements.txtpython training/train_classifier.py
python training/train_regressor.py
python training/evaluate.pycd backend
uvicorn main:app --reload --host 0.0.0.0 --port 8000Open frontend/index.html in your browser or serve via HTTP server.
curl -X POST "http://localhost:8000/predict" \
-H "Content-Type: application/json" \
-d '{
"age": 45,
"gender": "Male",
"height": 175,
"weight": 80,
"systolic_bp": 140,
"diastolic_bp": 90,
"heart_rate": 75,
"temperature": 98.6,
"diabetes": true,
"hypertension": false,
"smoking": false,
"alcohol": false,
"family_history": true,
"symptoms": ["chest_pain", "fatigue"],
"physical_activity": "Medium",
"sleep_hours": 7,
"stress_level": 3
}'- BMI calculation and risk scoring
- Blood pressure risk assessment
- Symptom severity scoring
- Lifestyle risk factors
- Family history analysis
- Classification Accuracy: >85%
- Regression MAE: <10%
- Cross-validation validated
IMPORTANT: This system is a medical decision support tool and NOT a replacement for professional medical diagnosis. Always consult qualified healthcare professionals for medical decisions. The predictions are based on statistical models and should not be used as sole basis for medical treatment.