CoolFace
Apppublic

nihalbarcin/mental-health-depression-prediction-ml

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
App README

Mental Health & Depression Prediction

This Hugging Face Space deploys a trained ensemble model for mental health and depression risk prediction with Streamlit + Docker.

Project Structure

bash
.
├── Dockerfile
├── requirements.txt
├── README.md
└── src
    ├── depression_model.pkl
    └── streamlit_app.py

Included Files

  • —src/streamlit_app.py → Streamlit user interface and prediction pipeline
  • —src/depression_model.pkl → Saved model and preprocessing artifacts
  • —requirements.txt → Python dependencies
  • —Dockerfile → Docker-based deployment for Hugging Face Spaces

How the app works

The app:

  1. 1.Loads the saved model and encoder artifacts from depression_model.pkl
  2. 2.Accepts user inputs from a clean Streamlit form
  3. 3.Rebuilds engineered features used during training
  4. 4.Runs prediction and, when available, prediction probability

Notes

  • —The model file contains a VotingClassifier ensemble.
  • —The app includes safe fallbacks for encoded categorical values.
  • —This is an educational demo and not a medical diagnostic tool.

Run locally

bash
pip install -r requirements.txt
streamlit run src/streamlit_app.py

Deploy on Hugging Face

Upload these files exactly in this structure:

bash
.
├── Dockerfile
├── requirements.txt
├── README.md
└── src
    ├── depression_model.pkl
    └── streamlit_app.py

The Space will build automatically after upload.