データの分布と変換

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面接対策

Passons à la pratique !

Pythonで学ぶMachine Learning面接対策

Preparing Video For Download...