An open API service indexing awesome lists of open source software.

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

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)

---