Views
No views yet
| Model | Micro-F1 | Macro-F1 | Subset Acc | Hamming Acc |
|---|---|---|---|---|
| Logistic Regression | 0.4448 | 0.2388 | 0.3156 | 0.9658 |
| LinearSVC (calibrated) | 0.5233 | 0.4266 | 0.3097 | 0.9542 |
| XGBoost | 0.5485 | 0.4044 | 0.4133 | 0.9622 |
tfidf_vectorizer.pkl — TF-IDF vectorizer (15k features, bigrams, sublinear TF)mlb.pkl — MultiLabelBinarizer (28 GoEmotions labels)logistic_regression.pkl — OneVsRest Logistic Regressionlinearsvc.pkl — OneVsRest LinearSVC (Platt-calibrated)xgboost.pkl — OneVsRest XGBoostthresholds_lr.pkl — per-class optimal thresholds for LR (numpy array, shape 28)thresholds_linearsvc.pkl — per-class optimal thresholds for LinearSVC (numpy array, shape 28)1import joblib, numpy as np
2
3tfidf = joblib.load("tfidf_vectorizer.pkl")
4mlb = joblib.load("mlb.pkl")
5model = joblib.load("xgboost.pkl") # or logistic_regression / linearsvc
6thresholds = joblib.load("thresholds_lr.pkl") # for LR; skip for XGBoost (use 0.30)
7
8X = tfidf.transform(["I am so happy and grateful today!"])
9proba = model.predict_proba(X)
10preds = (proba >= thresholds).astype(int) # shape (1, 28)
11labels = mlb.classes_[preds[0].astype(bool)]
12print(labels)