Analyzing workplace psychosocial factors and predicting mental health in the tech industry using machine learning.
This project undertakes a comprehensive data science investigation into mental health within the tech workplace. Leveraging the OSMI Mental Health in Tech Survey dataset, it aims to analyze various psychosocial factors and build predictive models to identify individuals at risk of mental health conditions. Through rigorous data preprocessing, feature engineering, and a comparative study of machine learning algorithms, the project provides insights into the intricate relationship between work environment and mental well-being, offering a data-driven approach to understanding and potentially mitigating mental health challenges in the technology sector.
- Data Ingestion & Preprocessing: Efficiently loading the
survey.csvdataset and performing cleaning, handling missing values, and encoding categorical features. - Exploratory Data Analysis (EDA): In-depth statistical analysis and visualization of workplace psychosocial factors to uncover patterns, correlations, and key insights.
- Feature Engineering: Creating new, more informative features from raw data to improve model performance and interpretability.
- Model Selection & Training: Implementation and training of multiple classification models, including Logistic Regression, Random Forest, and Support Vector Machines (SVM).
- Hyperparameter Tuning: Optimization of model parameters using
GridSearchCVto achieve the best possible predictive performance. - Model Evaluation & Comparison: Comprehensive evaluation of trained models using appropriate metrics and comparison of their performance to determine the most effective approach for mental health prediction.
To set up the environment and run the analysis notebook, follow these steps:
- Python 3.x: Ensure you have Python 3.9 or newer installed.
- Jupyter Notebook: The primary environment for running the analysis.
-
Clone the repository
git clone https://github.com/zeynpakn/mental-health-tech-analysis.git cd mental-health-tech-analysis -
Install dependencies It's recommended to create a virtual environment first:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
Then install the required Python packages:
pip install pandas numpy scikit-learn matplotlib seaborn jupyter
-
Start Jupyter Notebook From the project root directory, launch Jupyter:
jupyter notebook
-
Open the notebook Your browser will open to the Jupyter interface. Click on
VA_project.ipynbto open the analysis notebook. -
Execute cells Run the cells sequentially within the notebook to perform data preprocessing, analysis, model training, and evaluation.
mental-health-tech-analysis/
├── VA_project.ipynb # Main Jupyter Notebook for data analysis and ML
└── survey.csv # Dataset: OSMI Mental Health in Tech Survey
└── README.md
All configuration, including data loading, feature engineering parameters, and model hyperparameters, is managed directly within the VA_project.ipynb notebook. Users can modify the notebook cells to adjust parameters, experiment with different approaches, or extend the analysis.
While this project is primarily an analytical study, contributions in the form of improved analysis techniques, additional visualizations, or alternative machine learning models are welcome. Please fork the repository and submit a pull request with your suggested changes.
- OSMI Mental Health in Tech Survey: The invaluable dataset that forms the foundation of this analysis.
- Python Community: For the robust ecosystem of libraries (Pandas, NumPy, Scikit-learn, Matplotlib, Seaborn) that make such analyses possible.
- 🐛 Issues: Feel free to report any issues or suggest improvements via GitHub Issues.
⭐ Star this repo if you find this analysis insightful!
Made with ❤️ by zeynpakn & ozdogrumerve & Hkubrau
powered by caffeine, confusion, and cross-validation