The Student Stress Prediction System is a machine learning–powered Flask web application that analyzes 18 psychological, physical, and environmental factors to predict a student’s stress level (Low / Moderate / High) with 86.36% accuracy.
- This project fulfills the requirement of using Flask instead of Streamlit and delivers a professional, production-ready interface.
- Clean, modern, fully responsive Flask web interface
- Professional dark-blue corporate design
- 18 interactive sliders with real-time value display
- Instant prediction with color-coded results
- Pure Flask + HTML/CSS
- Model loaded once at server startup for fast predictions
- Zero external frontend frameworks
Stress-Predictor-Flask/ │ ├── app.py # Main Flask application + prediction logic ├── stress_classifier_model.pkl # Trained CatBoost model (86.36% accuracy) ├── templates/ │ └── index.html # Beautiful frontend UI └── static/ └── style.css # Professional dark-blue styling
- Source: Student Stress Factors Dataset
- Total Features Used: 18
- Target: Stress Level (0 = Low, 1 = Moderate, 2 = High)
- Anxiety Level (0–21) * Self-Esteem (0–30)
- Mental Health History (0/1) * Depression (0–27)
- Headache (0–5) * Blood Pressure (1–3)
- Sleep Quality (0–5) * Breathing Problem (0–5)
- Noise Level (0–5) * Living Conditions (0–5)
- Safety (0–5) * Basic Needs (0–5)
- Academic Performance (0–5) * Study Load (0–5)
- Teacher-Student Relationship (0–5)
- Future Career Concerns (0–5)
- Social Support (0–3) * Extracurricular Activities (0–5)
- Algorithm: CatBoost Classifier
- Accuracy: 86.36% (excellent for this dataset)
- Saved using joblib as stress_classifier_model.pkl
- Data collection & preprocessing
- Model training with CatBoost
- Achieved 86.36% accuracy
- Model saved using joblib
- Flask web app development
- Professional UI with sliders & instant prediction
- Two-column responsive layout
- Real-time output next to each slider
- Big centered “Predict” button
- Color-coded alert boxes (Success / Warning / Danger)
- Dark-blue gradient background with white card
- pip install flask joblib scikit-learn pandas catboost python app.py Open browser
- Python 3.8+
- Flask
- joblib
- scikit-learn
- pandas
- catboost