Search
 
SCRIPT & CODE EXAMPLE
 

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)
Comment

PREVIOUS NEXT
Code Example
Python :: view scrapy response in chrome from inside the spider 
Python :: importing cosine from scipy 
Python :: purge python3.y from every place in my path 
Python :: sumy library 
Python :: open file find and replace commas python 
Python :: webdriver antibot 
Python :: import sys execute cmd 
Python :: python message from byte 
Python :: Find the 15th term of the series?0,0,7,6,14,12,21,18, 28 
Python :: limiting a for each loop python 
Python :: django save another class data while saving a class 
Python :: dbscan multidimensional data 
Python :: tens place in digit 
Python :: pylatex multicolumn align 
Python :: how to resolve This typically means that you attempted to use functionality that needed an active HTTP request. Consult the documentation on testing for information about how to avoid this problem. in thread python 
Python :: RuntimeError: Please use tf.experimental.tensorrt.Converter in TF 2.0. site:stackoverflow.com 
Python :: easygui text adventure in python 3 
Python :: convert json file to dict - if comming as list 
Python :: nptel swayam 
Python :: python token stealer 
Python :: code suggestion html not working in django-html 
Python :: demploy django in vps 
Python :: assertionerror and buffererror are derived from which built-in python class 
Python :: django url with special characters in template 
Python :: python for infinite range 
Python :: How to Use Sets to Remove Duplicate Items in Other Data Structures 
Python :: Function to stop a while loop 
Python :: symmetric_difference_update() Function of sets in python 
Python :: Plot Multiple ROC Curves in Python 
Python :: flask-sqlalchemy inheritance 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =