mjpsm/Confidence-XGB
What it does
Predicts a personβs confidence level β Low
(0), Medium
(1), or High
(2) β from 10 numeric/ratio features.
Input Features (and how ratings affect predictions)
- self_efficacy (1β10) β belief in oneβs ability. Higher β more likely
High
. - past_success_rate (0β100) β % of goals achieved. Higher success β higher confidence.
- preparation_time_hours (0β40) β average prep hours. More prep β higher confidence (with plateau).
- feedback_positive_ratio (0β1) β positive / total feedback. Higher β higher confidence.
- support_system_strength (1β10) β perceived support. Higher β higher confidence.
- stress_management (1β10) β coping under pressure. Higher β higher confidence.
- growth_mindset (1β10) β belief skills improve with effort. Higher β higher confidence.
- resilience_score (1β10) β bounce-back ability. Higher β sustains confidence after setbacks.
- task_familiarity (1β10) β experience with task type. Higher β higher confidence.
- task_difficulty_perception (1β10) β perceived difficulty. Higher β lower confidence.
Labels
0
β Low,1
β Medium,2
β High
(Seelabel_map.json
.)
Training Summary
- Framework: XGBoost (hist)
- Data: 3,000 rows (balanced 1,000/class)
- Split: 70/15/15, early stopping=100
- Metrics (test): Acc 0.982, Macro-F1 0.982, LogLoss 0.046
Seetraining_summary.json
; confusion matrix inconfusion_matrix.png
.
Load & Predict
from huggingface_hub import hf_hub_download
from xgboost import XGBClassifier
import json, pandas as pd
REPO = "mjpsm/Confidence-XGB"
model_file = hf_hub_download(REPO, "xgb_model.json")
feat_file = hf_hub_download(REPO, "feature_order.json")
map_file = hf_hub_download(REPO, "label_map.json")
clf = XGBClassifier(); clf.load_model(model_file)
features = json.load(open(feat_file))
label_map = json.load(open(map_file))
inv = {v:k for k,v in label_map.items()}
x = pd.DataFrame([{
"self_efficacy": 8, "past_success_rate": 76, "preparation_time_hours": 12,
"feedback_positive_ratio": 0.72, "support_system_strength": 7, "stress_management": 6,
"growth_mindset": 9, "resilience_score": 8, "task_familiarity": 7, "task_difficulty_perception": 4
}])[features]
p = clf.predict_proba(x); pred_id = int(p.argmax(axis=1)[0])
print("Pred:", inv[pred_id], "(id:", pred_id, ")", "proba:", p[0].round(4).tolist())
Evaluation results
- accuracy on confidence_dataset_v1_3000 (synthetic, balanced)self-reported0.982
- macro_f1 on confidence_dataset_v1_3000 (synthetic, balanced)self-reported0.982
- log_loss on confidence_dataset_v1_3000 (synthetic, balanced)self-reported0.046