# 2. AI Prediction Configuration

User Type: **Super Administrator**
Source: *Mi Digital Academy - Education CRM Features Document*

---

## 2. AI Prediction Configuration

### 2.1 Prediction Algorithm Settings
**What it does:** Configures the prediction algorithm and its parameters for target exam score prediction.
**Sub-features:**
- Algorithm selection (regression, ensemble, per-exam-type).
- Algorithm parameters (weights, decay, smoothing).
- Per-exam-type algorithm overrides.
- Algorithm version control (active, rollback).
- available on web
- event logging (action performed)
- Audit logging of prediction algorithm settings
**Super Admin User Journey:**
1. Open Target Exam Management → AI Prediction → Algorithm.
2. Select the algorithm and set its parameters.
3. Define per-exam-type overrides where needed.
4. Set the active algorithm version.
5. Roll back if a new version underperforms.
**Rules & Edge Cases:**
- An algorithm with no parameters set uses the documented defaults.
- A per-exam-type override takes precedence over the global algorithm.
- A rollback restores the previous version's parameters exactly.
- An algorithm version in use by active predictions is not deleted.

### 2.2 Data Inputs for Prediction
**What it does:** Configures the data inputs the prediction algorithm consumes.
**Sub-features:**
- Mock test data inclusion (all, recent N, weighted by recency).
- Practice data inclusion (quizzes, SRS recall, assignments).
- Attendance data inclusion (live sessions, plan adherence).
- Data freshness requirement (max age of input data).
- available on web
- event logging (action performed)
- Audit logging of data inputs for prediction
**Super Admin User Journey:**
1. Open AI Prediction → Data Inputs.
2. Configure the mock test data inclusion.
3. Configure the practice and attendance data inclusion.
4. Set the data freshness requirement.
5. Save and verify predictions use the configured inputs.
**Rules & Edge Cases:**
- A data source with no data for a student is omitted (not zero-filled).
- A data source older than the freshness requirement is excluded.
- A student with insufficient data (below the minimum) gets no prediction (prompted to practice).
- A data input change applies to new predictions (not retroactively).

### 2.3 Confidence Interval Configuration
**What it does:** Configures the confidence intervals shown with each prediction.
**Sub-features:**
- Confidence interval width (e.g., ±5, ±10 points).
- Confidence display format (range, band, high/medium/low label).
- Low-confidence threshold (below which the prediction is flagged).
- Minimum data points for a prediction.
- available on web
- event logging (action performed)
- Audit logging of confidence interval configuration
**Super Admin User Journey:**
1. Open AI Prediction → Confidence Intervals.
2. Set the confidence interval width.
3. Choose the confidence display format.
4. Define the low-confidence threshold and minimum data points.
5. Save and verify predictions display the configured confidence.
**Rules & Edge Cases:**
- A prediction below the minimum data points is not shown (prompt to practice).
- A low-confidence prediction is always labeled, never shown as precise.
- A confidence interval width of zero is rejected (a range is always shown).
- A confidence display format change applies to all new predictions.

### 2.4 Real-Time Update Frequency
**What it does:** Configures how often predictions are recalculated.
**Sub-features:**
- Update frequency (real-time, hourly, daily, per-event).
- Event-triggered updates (mock test completed, plan milestone).
- Update batch size (students per batch).
- Update window (quiet hours to avoid peak load).
- available on web
- event logging (action performed)
- Audit logging of real-time update frequency
**Super Admin User Journey:**
1. Open AI Prediction → Update Frequency.
2. Set the update frequency (real-time, hourly, daily, per-event).
3. Configure the event-triggered updates.
4. Set the update batch size and window.
5. Save and verify predictions update per the frequency.
**Rules & Edge Cases:**
- An event-triggered update takes precedence over the scheduled frequency.
- A batch exceeding the batch size is split across multiple runs.
- An update during the quiet window is deferred to the window end.
- A failed update batch is retried; the last good prediction is retained.

### 2.5 Prediction Accuracy Tracking & Calibration
**What it does:** Tracks prediction accuracy against actual results and calibrates the algorithm.
**Sub-features:**
- Accuracy tracking (predicted vs actual per student/exam).
- Calibration curve (predicted probability vs observed frequency).
- Drift detection (accuracy degradation over time).
- Calibration report (per exam type, per cohort).
- available on web
- event logging (action performed)
- Audit logging of prediction accuracy tracking & calibration
**Super Admin User Journey:**
1. Open AI Prediction → Accuracy & Calibration.
2. Review the accuracy tracking (predicted vs actual).
3. Inspect the calibration curve.
4. Check the drift detection alerts.
5. Review the calibration report per exam type/cohort.
**Rules & Edge Cases:**
- A student with no actual result yet is excluded from accuracy tracking.
- A drift beyond the threshold raises an alert (retraining recommended).
- A calibration report with insufficient completed exams shows "insufficient data".
- An accuracy metric is never backfilled with estimated actuals.
