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
├── 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
pip install -r requirements.txtjupyter notebook project.ipynbuvicorn app:app --reload --host 0.0.0.0 --port 8000API documentation available at http://localhost:8000/docs
streamlit run streamlit_app.pyWeb interface available at http://localhost:8501
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"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
}
}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
- 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
- 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
- The dataset is synthetic and represents independent samples
user_iddoes not link records across tables- Some indicators showed similar values across groups, which is expected in synthetic medical datasets with comparable baseline distributions