표준화(Standardization) 평균과 표준편차가 각각 0과 1인 표준정규분포를 따르는 데이터로 전환하는 것으로 회귀분석, 로지스틱회귀분석과 같은 알고리즘에 유용합니다. 식 1과 같이 계산됩니다. $$x_\text{std}=\frac{x-\mu}{\sigma}$$ (식 1) sklearn.preprocessing.StandardScaler() 클래스와 zscore() 함수를 적용합니다. sklearn.preprocessing.StandardScaler(x) x는 2차원 배열 객체 자료를 식 1과 같이 표준화시키기 위한 클래스 .transform() 메서드를 사용하여 자료 변환. .inverse_transform() 메서드로 변환된 값에 대응하는 원시 데이터(raw data)로 환원. 변환에 사용된 평균과 분산은 각각 .mean_, .var_ 속성으로 반환. scipy.stats.zscore(x, axis=0, ddof=0) 배열, dataframe등의 객체(x)를 지정한 축에 따라 표준화 ddof: 자유도를 고려하기 위한 인수로서 '자유도=n-1'인 경우 'ddof=1'이 됩니다. axis=0: 행단위 그러므로 각 열기준으로 표준화 axis=1: 열단위 그러므로 각 행기준으로 표준화 import numpy as np import pandas as pd from sklearn import preprocessing from scipy import stats np.random.seed(0) x=np.random.randint(0, 100, size=(5,3)) print(x) [[44 47 64] [67 67 9] [83 21 36] [87 70 88] [88 12 58]] xStScaler=preprocessing.StandardScaler().fit(x) xScale3=xStScaler.transform...
python 언어를 적용하여 통계(statistics)와 미적분(Calculus), 선형대수학(Linear Algebra)을 소개합니다. 이 과정에서 빅데이터를 다루기 위해 pytorch를 적용합니다.