Views
No views yet
Low (0), Medium (1), or High (2) — from 10 numeric/ratio features.High.0 → Low, 1 → Medium, 2 → Highlabel_map.json.)training_summary.json; confusion matrix in confusion_matrix.png.1from huggingface_hub import hf_hub_download
2from xgboost import XGBClassifier
3import json, pandas as pd
4
5REPO = "mjpsm/Confidence-XGB"
6
7model_file = hf_hub_download(REPO, "xgb_model.json")
8feat_file = hf_hub_download(REPO, "feature_order.json")
9map_file = hf_hub_download(REPO, "label_map.json")
10
11clf = XGBClassifier(); clf.load_model(model_file)
12features = json.load(open(feat_file))
13label_map = json.load(open(map_file))
14inv = {v:k for k,v in label_map.items()}
15
16x = pd.DataFrame([{
17 "self_efficacy": 8, "past_success_rate": 76, "preparation_time_hours": 12,
18 "feedback_positive_ratio": 0.72, "support_system_strength": 7, "stress_management": 6,
19 "growth_mindset": 9, "resilience_score": 8, "task_familiarity": 7, "task_difficulty_perception": 4
20}])[features]
21
22p = clf.predict_proba(x); pred_id = int(p.argmax(axis=1)[0])
23print("Pred:", inv[pred_id], "(id:", pred_id, ")", "proba:", p[0].round(4).tolist())