Model Transparency

We believe you deserve to know exactly what's behind the "Analyze" button. Here are the real numbers โ€” strengths, limits, and all.

๐Ÿ”ง The pipeline

  1. Cleaning: lowercase, strip URLs/punctuation.
  2. TF-IDF vectorizer (1โ€“2 grams, 5,000 features) turns words into numbers.
  3. Logistic Regression (multinomial, balanced classes) predicts low / moderate / high.
  4. Group-aware split: paraphrases of the same example never leak across train/test โ€” the metrics below are honest.

๐Ÿ“Š Dataset

  • 870 labeled student-stress texts (sample dataset, 3 balanced classes).
  • Train: 701 ยท Test: 169 (held-out phrasings).
  • Retrain anytime: python wellness/ml/train.py
  • Swap in a real ethically-collected dataset via stress_dataset.csv โ€” see README.

๐ŸŽฏ Test-set performance

Overall accuracy: 0.94 on 169 unseen texts.

ClassPrecisionRecallF1-scoreSamples
low 1.001.00 1.0053.0
moderate 1.000.81 0.9053.0
high 0.861.00 0.9363.0

๐Ÿงฎ Confusion matrix

Rows = true label, columns = predicted label.

lowmoderatehigh
low 5300
moderate 04310
high 0063
Honest limits: this model reads word patterns, not minds. It can misread sarcasm, mixed emotions, very short texts, or writing styles unlike its training data. A "low" prediction never means someone is fine, and crisis language is handled by a separate safety check โ€” never by this classifier alone.