Scaled Before Split
This script reports 0.93 from 5-fold cross-validation. A month later the same model scores 0.71 on freshly collected data.
from sklearn.preprocessing import StandardScaler
from sklearn.feature_selection import SelectKBest
from sklearn.svm import SVC
from sklearn.model_selection import cross_val_score
X = SelectKBest(k=20).fit_transform(X_raw, y) # 1
X = StandardScaler().fit_transform(X) # 2
scores = cross_val_score(SVC(), X, y, cv=5) # 3
print(scores.mean()) # 0.93
Which single change makes the reported number honest?
Sign in to answer questions and track your progress
Sign In