Lab 02 - Probability¶
Goal: normalize scores and compute expected workload.
Info: Raw scores to routing
Raw model outputs must be normalized to probabilities. Then apply consistent thresholds and fallback policies across queues.
Info: Expected value
Calculate total effort from predicted intent mix. If average handle time per intent is known, estimate queue composition and staffing.
In [ ]:
Copied!
raw_scores = {"account_unlock": 6.0, "vpn_issue": 2.5, "security_incident": 1.5}
total = sum(raw_scores.values())
probs = {k: v / total for k, v in raw_scores.items()}
print("Probabilities:", probs)
print("Sum:", round(sum(probs.values()), 6))
raw_scores = {"account_unlock": 6.0, "vpn_issue": 2.5, "security_incident": 1.5}
total = sum(raw_scores.values())
probs = {k: v / total for k, v in raw_scores.items()}
print("Probabilities:", probs)
print("Sum:", round(sum(probs.values()), 6))
In [ ]:
Copied!
avg_handle_minutes = {
"account_unlock": 6,
"vpn_issue": 14,
"security_incident": 32,
}
expected_minutes = sum(avg_handle_minutes[k] * p for k, p in probs.items())
print("Expected handle minutes per ticket:", round(expected_minutes, 2))
avg_handle_minutes = {
"account_unlock": 6,
"vpn_issue": 14,
"security_incident": 32,
}
expected_minutes = sum(avg_handle_minutes[k] * p for k, p in probs.items())
print("Expected handle minutes per ticket:", round(expected_minutes, 2))
In [ ]:
Copied!
threshold = 0.80
top_intent = max(probs, key=probs.get)
top_prob = probs[top_intent]
print("Top intent:", top_intent, "probability:", round(top_prob, 3))
print("Auto-route:", top_prob >= threshold)
threshold = 0.80
top_intent = max(probs, key=probs.get)
top_prob = probs[top_intent]
print("Top intent:", top_intent, "probability:", round(top_prob, 3))
print("Auto-route:", top_prob >= threshold)