Skip to content
RED SAGSkills
medium10 pts · first answer countsdata-leakagescikit-learn

Scaling before splitting

What is wrong with this preprocessing code?

from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split

X_scaled = StandardScaler().fit_transform(X)
X_train, X_test, y_train, y_test = train_test_split(X_scaled, y, test_size=0.2)
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions