How saksham2311/mental-health-prediction-machinelearning works
Project type and purpose
• This is a standalone data-science/machine-learning project organized around a Jupyter notebook (MentalHealthPrediction.ipynb).
• Purpose: ingest a tech-workplace mental-health survey dataset, perform feature selection (ExtraTreesClassifier), train three models (LogisticRegression, KNeighborsClassifier, DecisionTreeClassifier), compare their accuracy, and output results to results.csv.
File structure
• Top-level files only—no subdirectories.
– survey.csv: raw input data.
– MentalHealthPrediction.ipynb: contains all data-loading, preprocessing, feature-extraction, model training, evaluation, and export code.
– results.csv: final performance metrics.
– README.md and LICENSE.
• No separate scripts, services, or deployment artifacts—this is a single-notebook ETL + ML pipeline.
Extract architecture insights from the README
• Dataset from Kaggle 2014 tech-workplace mental health survey.
• Feature importance via ExtraTreesClassifier.
• Three supervised learning algorithms used with accuracy comparison.
Main components
a. Data Ingestion Layer
– Component: CSV Data Source (survey.csv).
– Function: load raw survey records into memory.
b. Data Preprocessing & Feature Extraction
– Component: Notebook cell sequence or “Data Prep Module.”
– Sub-components:
• Cleaning (null handling, encoding).
• Feature selection (ExtraTreesClassifier).
c. Model Training
– Component: “Training Module” within the notebook.
– Sub-components for each algorithm:
• Logistic Regression
• KNeighborsClassifier
• DecisionTreeClassifier
d. Model Evaluation & Comparison
– Component: “Evaluation Module.”
– Generates accuracy metrics, confusion matrices.
e. Results Export
– Component: CSV Exporter
– Writes results.csv with model performance.
Architectural patterns & design principles
• Linear ETL + ML pipeline: data ingestion → transform → train → evaluate → export.
• Modularity: separate logical stages inside the notebook.
• Reusability points: you could extract code cells into functions or scripts for production.
Technologies and libraries
• Python & Jupyter Notebook (runtime environment).
• pandas / numpy (data handling).
• scikit-learn: ExtraTreesClassifier, LogisticRegression, KNeighborsClassifier, DecisionTreeClassifier.
• CSV I/O modules.