How do I use the same scale used in preprocessing with new data.
Actual code:
x = df.values #returns a numpy array
min_max_scaler = preprocessing.MinMaxScaler()
x_scaled = min_max_scaler.fit_transform(x)
df_scaled = pd.DataFrame(x_scaled)
clf = tree.DecisionTreeClassifier()
clf.fit(X_train, y_train)
pred = clf.predict(X_test)
If I understand it correctly I should have included a scaler variable with the StandardScaler.
Something like:
clf = tree.DecisionTreeClassifier()
clf.fit(X_train, y_train)
scaler = preprocessing.StandardScaler().fit(X_train)
pred = clf.predict(X_test)
What scaler parameters should I use for future data processing?
Thanks!