LoginSignup
0
0

More than 3 years have passed since last update.

FeatureScalingとはーーCourseraのMachineLeaningを完走したので復習するーー

Posted at

FeatureScalingとは

一言でいうと、featuresの取り得る値の範囲(スケール)を変化させ、全てのfeaturesの値の範囲を揃えること。

例: 家の価格予想(feature1:家のサイズ、feature2:部屋の数)
家のサイズ(feature1)と部屋の数(feature2)とでは取り得る範囲(スケール)が全く異なる。

X=
\begin{pmatrix}
2014\ & 3\\
1600\ & 3\\
.\ & . \\
.\ & .\\
1416\ & 2\\

\end{pmatrix}

Xのcolumn1が家のサイズ(feature1)、column2が部屋の数(feature2)

このように大きくスケールの異なるfeaturesを用いるとき、FeatureScalingによって、それぞれfeaturesが取り得る値の範囲を一定に揃える。

FeatureScalingを使う理由

大きく異なるスケールのfeaturesを用いる場合、学習(=GradientDescentの収束)に時間がかかったり、うまく学習できないということが起こり得る。ゆえにFeatureScalingによってfeaturesのスケールを前もって揃えておくべきなのである。

FeatureScalingの方法(Mean Normalization)

FeatureScalingの際には全ての変数xの値がおおよそ$-1 \leqq x_i \leqq 1$の範囲に収まるようにする。

$x_i=\dfrac {x_i-\mu_i }{s_i}$
$x_i$:feature i
$\mu_i$ : $x_i$の平均
$s_i$ :feature Iの値の範囲(max-min) もしくは 標準偏差(standerd division)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0