데이터 분포와 변환

Python으로 연습하는 Machine Learning 면접 질문

Lisa Stuart

Data Scientist

서로 다른 분포

데이터 분포

1 https://www.researchgate.net/figure/Bias-Training-and-test-data-sets-are-drawn-from-different-distributions_fig22_330485084
Python으로 연습하는 Machine Learning 면접 질문

학습/테스트 분할

train, test = train_test_split(X, y, test_size=0.3)

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3)

sns.pairplot() --> 분포와 산점도의 행렬을 그림

Python으로 연습하는 Machine Learning 면접 질문

데이터 변환

데이터 변환

1 https://www.researchgate.net/figure/Example-of-the-effect-of-a-log-transformation-on-the-distribution-of-the-dataset_fig20_308007227
Python으로 연습하는 Machine Learning 면접 질문
Box-Cox 변환

scipy.stats.boxcox(data, lmbda= )

lmbda (p) $x^p$ 변환
-2 $x^{-2} = 1/2$ 역수 제곱
-1 $x^{-1} = 1/x$ 역수
-0.5 $x^{-1/2} = 1/\sqrt{x}$ 역수 제곱근
0.0 $\log{(x)}$ 로그
0.5 $x^{1/2} = \sqrt{x}$ 제곱근
1 $x^1 = x$ 변환 없음
2 $x^2 = x$ 제곱
Python으로 연습하는 Machine Learning 면접 질문

연습해 봅시다!

Python으로 연습하는 Machine Learning 면접 질문

Preparing Video For Download...