Validation AUC drops in production
Review this Python cross-validation for a medical-imaging classifier.
CV AUC is 0.95 but a prospective study gets 0.70. Explain the gap.
What a strong answer looks like
Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix, specific and kind.
0:00 of about 20 min
Mark a line and say what kind of problem it is.0 findings
1import numpy as np
2from sklearn.model_selection import cross_val_score
3from sklearn.svm import SVC
4
5def evaluate(X, y):
6 # each patient contributes ~8 image patches; X is one row per patch
7 clf = SVC(kernel="rbf", probability=False)
8 scores = cross_val_score(clf, X, y, cv=5, scoring="roc_auc")
9 print("CV AUC:", scores.mean())
10 return scores.mean()
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.
Run or narrate your approach, then ask the coach.