Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Social Media & Mental Health Analysis

Project Overview

This project analyzes the relationship between social media usage patterns and mental health outcomes using a comprehensive synthetic dataset of 470,000 records across 10 CSV files.

Dataset covers:

  • AI recommendation impact
  • Cyberbullying
  • Digital detox behavior
  • Dopamine triggers
  • Psychological forecasts
  • Mental health trends
  • Screen time behavior
  • Sleep disruption
  • Social media usage
  • Teen behavior patterns

Project Structure

├── data/                          # Dataset CSV files
├── project.ipynb                  # Jupyter Notebook with full analysis
├── app.py                         # FastAPI REST API
├── streamlit_app.py               # Streamlit web interface
├── requirements.txt               # Python dependencies
└── README.md                      # This file

Installation

pip install -r requirements.txt

Running the Project

1. Jupyter Notebook

jupyter notebook project.ipynb

2. FastAPI Server

uvicorn app:app --reload --host 0.0.0.0 --port 8000

API documentation available at http://localhost:8000/docs

3. Streamlit Web Interface

streamlit run streamlit_app.py

Web interface available at http://localhost:8501

API Endpoints

GET /data

Retrieve filtered dataset records with pagination.

Query parameters:

  • dataset (str): Dataset name (e.g., "mental_health_trends")
  • limit (int): Number of records to return (default: 100, max: 1000)
  • offset (int): Number of records to skip (default: 0)

Example:

curl "http://localhost:8000/data?dataset=mental_health_trends&limit=50&offset=0"

POST /data

Add a new record to a dataset.

Request body:

{
  "dataset": "mental_health_trends",
  "record": {
    "anxiety_score": 75.0,
    "depression_score": 60.0,
    "stress_level": 80.0
  }
}

Analysis Summary

The project includes:

  • Descriptive statistics for 5 key numerical fields
  • Data cleanup verification (no missing values, no duplicates)
  • Visualizations: histograms, scatter plots, bar charts, heatmaps, violin plots, line plots
  • Hypothesis testing: t-tests, ANOVA, effect sizes (Cohen's d)
  • Data transformation: composite risk indices and categorical encodings
  • Advanced modeling: PCA and K-Means clustering

Key Findings

  • Cyberbullying exposure significantly increases self-harm risk scores, with notable differences between age groups
  • Among users with high emotional manipulation index, those with high algorithmic content exposure show significantly higher AI addiction probability
  • PCA on mental health data explains >70% variance with 2-3 components
  • K-Means clustering identifies 3 distinct mental health profiles

Team Contribution

  • Data loading and cleaning: automated pipeline for 10 CSV files
  • Exploratory analysis: descriptive statistics, distributions, correlations
  • Hypothesis testing: t-tests, ANOVA, and interaction analysis
  • Advanced modeling: PCA and K-Means clustering
  • Data transformation: composite risk indices and categorical encodings
  • Web interface: FastAPI REST API and Streamlit frontend

Notes

  • The dataset is synthetic and represents independent samples
  • user_id does not link records across tables
  • Some indicators showed similar values across groups, which is expected in synthetic medical datasets with comparable baseline distributions

mental_health_py

About

Projected connected to dataset analysis from kaggle: https://www.kaggle.com/datasets/abdulmaliklodhra/social-media-addiction-and-mental-health-dataset/data

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages