#πŸ”’ XGBoost + TF-IDF for emotion prediction β€” good state accuracy but struggling with intensity (need

4 messages Β· Page 1 of 1 (latest)

hollow leaf
#

Hey everyone,
I’m working on a small ML project (~1200 samples) where I’m trying to predict:

  1. Emotional state (classification β€” 6 classes)
  2. Intensity (1–5) of that emotion
    The dataset contains:
  • journal_text (short, noisy reflections)
  • metadata like:
    • stress_level
    • energy_level
    • sleep_hours
    • time_of_day
    • previous_day_mood
    • ambience_type
    • face_emotion_hint
    • duration_min
    • reflection_quality

πŸ”§ What I’ve done so far

1. Text processing

Using TF-IDF

2. Metadata

  • Converted categorical (face_emotion_hint) to numeric
  • Kept others as numerical
  • Handled missing values (NaN left for XGBoost / simple filling)
    Scaled metadata using StandardScaler

3. Models

Emotional State (Classification)

Using XGBClassifier:

  • accuracy β‰ˆ 66–67%
    Classification report looks decent, confusion mostly between neighboring classes.

Intensity (Initially Classification)

  • accuracy β‰ˆ 21% (very poor)

4. Switched Intensity β†’ Regression

Used XGBRegressor:

  • predictions rounded to 1–5
    Evaluation:
  • MAE β‰ˆ 1.22

Current Issues

1. Intensity is not improving much

  • Even after feature engineering + tuning
  • MAE stuck around 1.2
  • Small improvements only (~0.05–0.1)

2. TF-IDF tuning confusion

  • Reducing features (500) β†’ accuracy dropped
  • Increasing (1000–1500) β†’ slightly better
    Not sure how to find optimal balance

3. Feature engineering impact is small

  • Added multiple features but no major improvement
  • Unsure what kind of features actually help intensity

Questions

  1. Are there better approaches for ordinal prediction (instead of plain regression)?
  2. Any ideas for better features specifically for emotional intensity?
  3. Should I try different models (LightGBM, linear models, etc.)?
  4. Any better way to combine text + metadata?
    Would really appreciate any suggestions or insights πŸ™
tight sandalBOT
#

@hollow leaf

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

tight sandalBOT
#

@hollow leaf

Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.