In today's fast-paced world, mental health challenges like mood swings often go unnoticed or undiagnosed, leading to severe consequences for individuals' well-being. While professional care is essential, early detection using accessible and non-invasive methods can help people become more aware of their mental state and seek support when necessary. This project aims to provide a lightweight, AI-powered solution that predicts mood swing tendencies based on survey-style inputs, making it easier to monitor and reflect on mental health.
- A FastAPI-based RESTful API for making predictions.
- A Streamlit web application for users to interact with the model via a simple UI.
- Input form for mental health and lifestyle-related data
- Real-time mood swing prediction
- Simple API to connect front-end and back-end
- Python 3.10+
- Scikit-learn
- XGBoost
- Pandas, NumPy
- FastAPI
- Streamlit
- Joblib
├── app/
│ ├── main.py # FastAPI app for serving predictions
├── model/
│ ├── xgb_model.pkl # Trained XGBoost model
│ ├── encoder.pkl # Saved label encoders (as a dictionary)
│ ├── train_model.py # Script to train and save the model
├── streamlit_app/
│ ├── app.py # Streamlit web application
├── data/
│ ├── raw_data.csv # Original dataset
│ └── cleaned_data.csv # Cleaned and preprocessed dataset
├── PipFile # Python dependencies
└── README.md
Frontend
- Live App:
MoodFlag Streamlit App
Backend (API)
- API Docs (Swagger UI):
📘 MoodFlag API Documentation
Dataset & Model Exploration
- Kaggle Notebook:
📈 ML Applications to Mental Health Diagnosis