Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

StandardScaler sklearn get params normalization

from sklearn.preprocessing import StandardScaler
scaler = StandardScaler()
scaler.fit(data)
scaled_data = scaler.transform(data)

means = scaler.mean_ 
vars = scaler.var_   

# for later usage of means and vars
def scale_data(array,means=means,stds=vars **0.5):
    return (array-means)/stds

scale_new_data = scale_data(new_data)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #StandardScaler #sklearn #params #normalization
ADD COMMENT
Topic
Name
3+3 =