I am used to running sklearn's standard scaler the following way:
from sklearn.preprocessing import StandardScaler
scaler = StandardScaler().fit(X_train)
scaled_X_train = scaler.transform(X_train)
Where X_train is an array containing the features in my training dataset.
I may then use the same scaler to scale the features in my test dataset X_test:
scaled_X_test = scaler.transform(X_test)
I know that I may also "bake" the scaler in the model, using sklearn's make_pipeline:
from sklearn.pipeline import make_pipeline
clf = make_pipeline(preprocessing.StandardScaler(), RandomForestClassifier(n_estimators=100))
But then how do I use the scaler? Is it enough to call the model like I normally would, i.e.:
clf.fit(X_train,y_train)
And then:
y_pred = clf.predict(X_test)
?