Spaces:
Sleeping
Sleeping
Model Card: Risk Model
Model Details
- Model Name: risk_model
- Model Version: risk_model_v2_baseline_001
- Algorithm: RandomForestClassifier (class_weight="balanced")
- Framework: scikit-learn
- Trained At: 2026-05-21T05:59:12.289643+00:00
- Seed: 42
Intended Use
Predict whether a student is at-risk (binary: 0=not at-risk, 1=at-risk) based on mastery, performance, and engagement features. Used in the risk prediction endpoint to identify students who may need intervention. Primary optimization target is recall on the positive class to minimize missed at-risk students.
Training Data
- Source: training_risk_prediction.csv (synthetic dataset v2)
- Split Counts: train=1133, validation=243, test=244
- Features: avg_mastery_score, weak_lo_count, developing_lo_count, mastered_lo_count, avg_confidence, avg_accuracy, avg_marks_ratio, avg_time_seconds, hint_usage_rate, total_attempts, attendance_percentage, assignment_completion_rate, average_login_per_week, inactive_days_last_14, avg_active_minutes, total_logins, avg_video_watch_ratio, total_content_completed, total_quiz_attempts (all numeric, 19 features)
- Target: risk_label (binary 0/1)
- Class Imbalance: ~16% positive class, addressed via class_weight="balanced"
Metrics
Validation Set
- Recall (positive): 0.8333
- Precision (positive): 0.9459
- F1 (positive): 0.8861
- ROC-AUC: 0.99
Test Set
- Recall (positive): 0.7812
- Precision (positive): 0.9259
- F1 (positive): 0.8475
- ROC-AUC: 0.9899
Per-Class Performance (Test Set)
| Class | Precision | Recall | F1 | Support |
|---|---|---|---|---|
| not_at_risk | 0.9677 | 0.9906 | 0.979 | 212 |
| at_risk | 0.9259 | 0.7812 | 0.8475 | 32 |
Risk Level Recall (Test Set)
| Risk Level | Recall | Support |
|---|---|---|
| high | 0.7407 | 27 |
| critical | 1.0 | 5 |
Known Limitations
- Trained on synthetic data only — performance on real student data is unknown.
- Binary risk_label derived from synthetic risk_score thresholds.
- All features are numeric; no text or contextual features used.
- Class imbalance (~16% positive) addressed via class_weight="balanced".
- Critical class (~2%) is very rare; recall on critical should be monitored.
- No temporal features (trend over time) included in this baseline.
Fallback Behavior
When the model is not loaded or confidence is below the threshold (0.55), the system falls back to rule-based risk estimation using:
- inactive_days_last_14 > 7 → high risk
- attendance_percentage < 60% → high risk
- avg_mastery_score < 0.4 → medium risk
- Otherwise → low risk