Developed a machine learning system that understands user emotions from journal text and suggests what the user should do and when.
-
Install required libraries: pip install pandas numpy scikit-learn matplotlib
-
Place the files:
- training_data.xlsx
- testing_data.xlsx
-
Open the notebook: ML_Project.ipynb
-
Run all cells step by step
The system works in 3 main steps:
- Understand emotion from text
- Predict how strong the emotion is (intensity)
- Suggest what action the user should take and when
We used two types of features:
- Used TF-IDF (Term Frequency - Inverse Document Frequency)
- Converts text into numbers
- Captures important words and phrases
- sleep_hours
- stress_level
- energy_level
- time_of_day
- ambience_type
- previous_day_mood
- face-emotion hint
- reflection quality
These are scaled using StandardScaler
We used:
- Model: Linear SVM (LinearSVC)
- Reason: Works well for text classification
- Model: Ridge Regression
- Reason: Simple and stable for numeric prediction
- Train model using training dataset
- Generate predictions on test dataset
- Run decision engine
- Create final predictions.csv
Output includes:
- predicted_state
- predicted_intensity
- confidence
- uncertain_flag
- what_to_do
- when_to_do
- supportive_message
State: focused
Intensity: 3
Action: deep_work
When: now
Test dataset does not have labels, so evaluation metrics like accuracy and MSE are calculated only on training data.