Inspiration
The inspiration for Student 360 came from my personal experience as a student, where balancing academic performance and lifestyle choices often felt overwhelming. I noticed that factors like study hours, stress levels, sleep, and exercise significantly impacted academic success, but there wasn't an easy way to quantify this relationship. I wanted to create a tool that would not only predict a student's GPA based on lifestyle choices but also provide actionable insights to optimize their daily habits and improve academic performance.
What I Learned
Through the development of Student 360, I deepened my understanding of machine learning, specifically how to train and deploy predictive models. I also gained practical experience in data preprocessing, model training, and integrating machine learning models into a web application.
In terms of technical skills:
- Data Preprocessing: I learned how to clean and scale data, handle missing values, and encode categorical variables to make them usable for machine learning.
- Model Training: I trained a Linear Regression model to predict GPA based on lifestyle factors like study hours and stress levels.
- Streamlit: I improved my skills in creating interactive, user-friendly web applications with Streamlit, enabling real-time data entry, prediction, and visualization.
How I Built It
The app was built using Streamlit for the frontend and a Linear Regression model for GPA prediction. Below is a detailed breakdown of the individual components:
1. Data Preprocessing (model.py)
The data preprocessing script handles the cleaning and preparation of the dataset:
- Handling Missing Values: For any missing values in the "Study_Hours_Per_Day" column, I filled them with the mean value of that column.
- Label Encoding: The categorical variable "Stress_Level" (with values like Low, Moderate, and High) was transformed into numerical values using LabelEncoder.
- Scaling: Both the "Study_Hours_Per_Day" and "GPA" columns were standardized using StandardScaler to improve model performance and make the features comparable in scale.
2. Model Training and Prediction (model.py)
I used a Linear Regression model to predict GPA based on study hours and stress levels:
- Training the Model: The dataset was split into training and testing sets (80%/20%). The model was then trained on the training set and evaluated on the test set using Mean Squared Error (MSE) to measure its accuracy.
- Saving and Loading the Model: After training, the model was saved as a
.pklfile using joblib, allowing easy deployment in the app. The model was loaded for real-time predictions in the Streamlit app.
3. Streamlit App (app.py)
- User Interface: The app was built using Streamlit, allowing users to input lifestyle factors like study hours, stress levels, sleep hours, screen time, and exercise frequency through sliders and select boxes.
- Prediction and Recommendations: Once the user enters the data, the app uses the trained model to predict the GPA and provide personalized recommendations, such as increasing study hours or reducing screen time, based on the user's input.
- Visualization: I implemented real-time visualizations to show how study hours correlate with GPA, using matplotlib and seaborn for dynamic charting.
- Exportable Reports: After each prediction, users can download a CSV report containing their input data and the predicted GPA for further tracking.
4. Other Functionalities
- Goal Setting: The app includes a feature where users can set study goals and track them. These goals are stored and can be downloaded as a CSV file.
- AI Chatbot: The app contains a simple AI chatbot that answers common questions about GPA improvement, study habits, and other app features.
Challenges I Faced
- Data Quality: The initial dataset had missing values and unscaled data, which required preprocessing to handle correctly. Finding a good method to handle missing values and scaling the features appropriately was challenging but crucial for model performance.
- Model Performance: Initially, the linear regression model didn't provide very accurate predictions due to the limited features (only study hours and stress level). Adding more lifestyle factors such as sleep, exercise, and screen time may improve the model’s accuracy in the future.
- Real-time Performance: Ensuring the app was responsive and updated the predictions in real time without delays was a challenge. I had to optimize the data handling process to prevent lag, especially when visualizing the real-time study hours vs. GPA chart.
What’s Next
While the app provides useful predictions and insights, I plan to:
- Expand the Model: Integrate more factors like sleep quality, diet, and mental health into the model to provide a more holistic prediction of a student’s GPA.
- Enhance UI/UX: Improve the user interface by adding more dynamic interactions and making the app even more intuitive.
- Optimize Model: Explore advanced models and hyperparameter tuning to increase prediction accuracy.
- Mobile App: Develop a mobile version of the app to make it more accessible for students on the go.
Conclusion
Student 360 is a tool that combines machine learning with lifestyle management to help students understand how their habits affect their academic success. With personalized recommendations, real-time GPA predictions, and goal-setting features, the app empowers students to make data-driven decisions that can lead to better academic outcomes. This project not only helped me improve my technical skills but also gave me the opportunity to build something that can potentially make a positive impact on students' lives.
Built With
- joblib
- labelencoder
- linear-regression
- matplotlib
- pandas
- python
- scikit-learn
- seaborn
- standardscaler
- streamlit
- student-lifestyle-data.csv
Log in or sign up for Devpost to join the conversation.