https://github.com/egonlh/_moodflag
An interactive web application that predicts mental health risk based on user input
https://github.com/egonlh/_moodflag
classification machinelearn python streamlit
Last synced: about 1 month ago
JSON representation
An interactive web application that predicts mental health risk based on user input
- Host: GitHub
- URL: https://github.com/egonlh/_moodflag
- Owner: EgonLh
- Created: 2025-06-26T09:37:07.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-06-29T12:54:53.000Z (12 months ago)
- Last Synced: 2025-09-04T02:48:07.398Z (10 months ago)
- Topics: classification, machinelearn, python, streamlit
- Language: Jupyter Notebook
- Homepage: https://moodflag-yxmsxx9v3vkkrjhphbqopn.streamlit.app/
- Size: 4.34 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mood Swing Prediction API and Streamlit Web App
## Problem Statement
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.
## Project Overview
- A **FastAPI-based RESTful API** for making predictions.
- A **Streamlit web application** for users to interact with the model via a simple UI.
## Features
- Input form for mental health and lifestyle-related data
- Real-time mood swing prediction
- Simple API to connect front-end and back-end
## Tech Stack
- Python 3.10+
- Scikit-learn
- XGBoost
- Pandas, NumPy
- FastAPI
- Streamlit
- Joblib
## Folder Structure
```bash
├── 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
```
# MoodFlag Project Resources
Frontend
- **Live App:**
[ MoodFlag Streamlit App](https://moodflag-yxmsxx9v3vkkrjhphbqopn.streamlit.app/)
Backend (API)
- **API Docs (Swagger UI):**
[📘 MoodFlag API Documentation](https://moodflag-api.onrender.com/docs)
Dataset & Model Exploration
- **Kaggle Notebook:**
[📈 ML Applications to Mental Health Diagnosis](https://www.kaggle.com/code/maxboonjindasup/ml-applications-to-mental-health-diagnosis#Model-Building-&-Comparisons)
---