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
- Cleaning: lowercase, strip URLs/punctuation.
- TF-IDF vectorizer (1โ2 grams, 5,000 features) turns words into numbers.
- Logistic Regression (multinomial, balanced classes) predicts low / moderate / high.
- 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.
| Class | Precision | Recall | F1-score | Samples |
|---|---|---|---|---|
| low | 1.00 | 1.00 | 1.00 | 53.0 |
| moderate | 1.00 | 0.81 | 0.90 | 53.0 |
| high | 0.86 | 1.00 | 0.93 | 63.0 |
๐งฎ Confusion matrix
Rows = true label, columns = predicted label.
| low | moderate | high | |
|---|---|---|---|
| low | 53 | 0 | 0 |
| moderate | 0 | 43 | 10 |
| high | 0 | 0 | 63 |
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.