Coding problemINTERMEDIATEDifficulty: INTERMEDIATEValidation~8 min

Spot the leakage in this pipeline

This model scores 0.94 AUC in cross-validation and 0.71 in production. Find the leak.

python
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import cross_val_score

scaler = StandardScaler()
X_scaled = scaler.fit_transform(X)

scores = cross_val_score(model, X_scaled, y, cv=5)