Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

STandardScaler use example

from sklearn.preprocessing import StandardScaler
scaler = StandardScaler()
scaled_data = scaler.fit_transform(data)
Comment

sklearn standardscaler

from sklearn.preprocessing import StandardScaler
data = [[0, 0], [0, 0], [1, 1], [1, 1]]
scaler = StandardScaler()
print(scaler.mean_)
>>>[0.5 0.5]
print(scaler.transform(data))
>>>[[-1. -1.]
   [-1. -1.]
   [ 1.  1.]
   [ 1.  1.]]
Comment

standardscaler

# Preprocessing allows us to standarsize our data
from sklearn import preprocessing
# define standard scaler
scaler = StandardScaler()
# transform data
scaled = scaler.fit_transform(data)
Comment

PREVIOUS NEXT
Code Example
Python :: python datetime now only hour and minute 
Python :: clear console python 
Python :: size of variable python 
Python :: pylint no name in module cv2 
Python :: portscan with python 
Python :: pandas columns starting with 
Python :: python alphabet 
Python :: django today date in template 
Python :: cos in python in degrees 
Python :: how to install wxpython 
Python :: flask install 
Python :: check cuda version pytorch 
Python :: extract ints from strings in Pandas 
Python :: install magic python 2 
Python :: selenium exception handling python 
Python :: python word cloud 
Python :: genspider scrapy 
Python :: python print colored text 
Python :: python jwt parse 
Python :: log base 2 python 
Python :: how to change column type to string in pandas 
Python :: import matplotlib.pyplot as plt 
Python :: python read gzipped file 
Python :: how to get all links text from a website python beautifulsoup 
Python :: python random.choices vs random.sample 
Python :: python f-string format date 
Python :: how to increase height of entry in tkinter 
Python :: extract frames from video python 
Python :: plotly add hline dashed 
Python :: python remove read only file 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =