This project focuses on predicting student mental health, specifically determining the presence or absence of depression. The workflow includes preprocessing data, training machine learning models, tracking performance with MLflow, saving the best model in ONNX format, and creating REST APIs with FastAPI and Flask. Additionally, both the machine learning model and the application are packaged as Docker containers for deployment flexibility.
The dataset used in this project contains information relevant to student mental health, including features that contribute to predicting depression.
![image](https://private-user-images.githubusercontent.com/75739113/287406867-7c432f83-30a8-4561-a4bc-3dcd63f0d7d0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTgzMDIxNTUsIm5iZiI6MTcxODMwMTg1NSwicGF0aCI6Ii83NTczOTExMy8yODc0MDY4NjctN2M0MzJmODMtMzBhOC00NTYxLWE0YmMtM2RjZDYzZjBkN2QwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjEzVDE4MDQxNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTE4MzFmYmE4NjE3ZTJmZjY4NmVhMjM3YzZjMzM5MWI5Y2YyMzgxNzg5MjNjYzViYjAyMTQ3MTExZjQ5NmJmMzkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.X20GMl_2NQoNTxsD8oJC8VDLTGXgBUMKsx-neVDIV6Q)
Dataset columns :
- Timestamp
- 'Choose your gender': 'gender'
- 'Age ' : 'age'
- 'What is your course?': 'major'
- 'Your current year of Study': 'year'
- 'What is your CGPA?': 'CGPA'
- 'Marital status': 'Marriage'
- 'Do you have Depression?': 'Depression'
- 'Do you have Anxiety?': 'Anxiety'
- 'Do you have Panic attack?': 'Panic'
- 'Did you seek any specialist for a treatment?': 'treatment'
- Support Vector Machine (SVM)
- K-Nearest Neighbors (KNN)
- Random Forest
- Decision Tree
- Gradient Boosting Classifier
MLflow is an open-source platform for managing the end-to-end machine learning lifecycle. It enables tracking experiments, packaging code into reproducible runs, and sharing and deploying models. In this project, MLflow is employed for tracking model performance, versions, and parameters.
-
Train five machine learning models using various algorithms
-
Tracking Model Performance, Versions, and Parameters
-
Saving Best Model in ONNX Format
-
Serialize and save preprocessing transformations using in pickle format.
FastAPI is a modern, fast (high-performance), web framework for building APIs. In this project, FastAPI plays a crucial role in creating a robust and efficient REST API to serve machine learning models predicting student mental health.
- Use FastAPI to create a REST API for serving machine learning models.
- Packaging Model as a Docker Container
- Package the machine learning model as a Docker container for easy deployment and scalability.
Flask is utilized to create a dedicated web application that interacts with the machine learning API. The Flask application serves as an intuitive interface for users to engage with the underlying predictive models for student mental health.
- Develop a dedicated application using Flask to consume the machine learning API.
![image](https://private-user-images.githubusercontent.com/75739113/287406701-1b83c690-2e7f-4934-9791-d00c766a9ed3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTgzMDIxNTUsIm5iZiI6MTcxODMwMTg1NSwicGF0aCI6Ii83NTczOTExMy8yODc0MDY3MDEtMWI4M2M2OTAtMmU3Zi00OTM0LTk3OTEtZDAwYzc2NmE5ZWQzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjEzVDE4MDQxNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI0YTQ3NmU0NmM1YmVjYmFkMzUxYWYwYTY0Mzg3Y2E2Y2MyZmZhZjRjZmMyNjAzNDBmNDk0NmI0NjcyYWJmNGYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.o3IrWARTjX6ypGkZA2EvLd6-wtrGGoBzVIfB7Dx8WFc)