I use scikit learning StandardScaler () and notice that after applying transform (xtrain) or fit_transform (xtrain) it also changes my xtrain dataframe. Is this supposed to happen? How can I avoid changing the StandardScaler of my framework? (I tried using copy = False)
xtrain.describe()
scalar = StandardScaler()
xtrain2 = scalar.fit_transform(xtrain)
At this point, I expected xtrain to NOT change, and xtrain2 to become a scaled version of xtrain. But when I start to describe () on 2 frames of data, I see that they are both the same and both were scaled. Why is this?
I experience the same problem when I do this:
scalekey = scalar.fit(xtrain)
xtrain2 = scalekey.transform(xtrain)
source
share