線形SVM ~アルゴリズム~ 線形識別関数①

線形SVM ~アルゴリズム~
線形識別関数①

 

下図の青色と赤色の線を2つに綺麗に分けようとすると

SVM_1

このようになります。このような赤色の線の式(識別関数)を求める
ということが分類問題で重要になります。

このような線形な識別関数を”線形識別関数”と呼び、
要は、この識別関数のどっちにあるかで分類したい。
(今は右にあれば赤点、左にあれば青点ですね)
それならこの識別関数求めるだけで後は
簡単な計算って話にしたいんです。

実際これが求まっちゃえば簡単です。例えば
識別関数が
$$f(x)=x+3$$
とします。
とすれば、識別境界(境界線)は
$$f(x)=x+3=0の時です$$
xは実際のデータの値を代入するもので
f(x)>0ならば赤色、f(x)<=0なら青色と判定することにします。

それなら実際のxの値を代入するだけで色を決めることができます。
ですので識別関数が求まっちゃえば
精度はさておき判定は楽です。

一般的にこの識別関数は

ユーザー毎の変数の実際の値(身長や体重)を
$$\vec{ x }={}^t \! ( x_1, x_2, \ldots, x_d )と表し$$
同様に

そのユーザー毎にかかる変数の係数を(回帰係数みたいなもの)
$$\vec{ w }={}^t \! ( w_1 ,w_2, \ldots, w_d )$$
と表します。
今dが最後の文字となりますが、これは
ユーザーの特徴(変数)がd個あるということです。
ちなみにdは次元の英語dimensionのdです。(多分)

式中のtは以下の行列のAの
$${}^t \!A$$
の転置を示すtであり、教科書などでは本当は縦ベクトルだけど
縦に書いたらスペースがおかしくなる。
とかの問題や、内積とか定義する時に同じベクトル
$$\boldsymbol{a} \cdot\boldsymbol{ a }$$
が定義できないので、
$$\boldsymbol{ a }\cdot{}^t \! \boldsymbol{ a }$$
のようにすることでよく使われます。
$$A^{ \mathrm{ T } }$$
と書く場合もありますが、同じです。
個人的には$${}^t \!A$$
の書き方の方が好き(学生時習ったのがこれ)なので
こっちに統一します。

さて、ベクトルを太字記号にして
$$\boldsymbol{ w }={}^t \! ( w_1, w_2, \ldots, w_d )$$
$$\boldsymbol{ x }={}^t \! ( x_1, x_2, \ldots, x_d )$$

これらを使って、識別関数を

$$f(\boldsymbol{ x })={}^t \! \boldsymbol{ w }
\cdot \boldsymbol{ x } +w_0$$

と表します。
$$\cdotは内積で、w_0は切片(バイアス項)です$$

$$\boldsymbol{ w }={}^t \! ( w_1, w_2, \ldots, w_d )$$
$$\boldsymbol{ x }={}^t \! ( x_1, x_2, \ldots, x_d )$$
$$は共にd次元で、\boldsymbol{ w }には$$
$$転置がかかっているので内積が計算できます$$
実際、内積を展開すると
$$f(\boldsymbol{ x })={}^t \! \boldsymbol{ w }
\cdot \boldsymbol{ x } +w_0$$
$$\Updownarrow$$
$$w_1x_1+w_2x_2+・・・+w_dx_d+w_0=f(\boldsymbol{ x })$$
となります。

そして今、
$$\boldsymbol{ w }とw_0という未知のパラメータと
実際のデータの値が入る\boldsymbol{ x }がありますが
\boldsymbol{ w }とw_0を推定し、$$
識別関数を決定して実際データxを代入し
f(x)=0の識別境界に対し、
f(x)>0なのか、f(x)<0なのかということを使って
$$実際のデータ\boldsymbol{ x }が識別関数の
どっち側があるのかが知りたいこととなります。$$

 

次項

線形SVM ~アルゴリズム~ 線形識別関数②

SNSでもご購読できます。

コメント

  1. SEO より:

    An excellent method to do that is to type your foremost key
    phrase plus various massive city names into Google and copy the most commonly
    ranking ones. Make sure your primary class is matched up as close as possible
    with the principle keyword(s) that you’re trying to rank.
    You may even want to go back and alter your entire NAP
    info to the brand new keyword centered business title for
    a attainable additional advantage. Bonus Tip: if you want to rank higher
    in Google Maps and natural search, avoid key phrase cannibalization.
    This will get you a lift, thus bettering your Google Maps and
    organic search ranking. While there’s no magic, there are steps you can take to soar to the top of a search engine outcomes web
    page (SERP). While Matt Cutts said in this video that
    “the distinction between a six-month-old domain and a one-year-old area name shouldn’t be huge in any respect,” that doesn’t mean it’s irrelevant.
    Take a look at the video below to study more.
    Take a look at the video beneath to learn extra about my methods for link constructing, on-page SEO, and person metrics when trying to rank on Google.
    Listed here are crucial metrics to evaluate. https://dexia-phbank.dk/

  2. SEO Guides and Tips より:

    But do not over-do it as a result of it might probably develop into tiring to read by way of such an article the place the author
    has turn into far too modifying blissful. I might be editing and re-modifying a put up time and
    again however yet it by no means sticks that method. This way it ensures the white house is left intact.
    With fairly a little bit of white space, notably in an extended article, its really so much easier to
    read by. Its nearly like, after i learn an article and I’ve a fast glance through before I set off upon my reading
    journey, if I see more white space, I’m probably extra inclined to read.
    Do add in a lot of white house to your posts/articles. Ensure you add in white house to YOUR
    articles! Again right here, the articles or blog posts that I learn that have
    me smiling, laughing, bawling with tears running down my face –
    these infants are the ones that I will rarely if ever neglect.
    Okay, nothing new right here, right… If you can, add in level
    by point and break up your paragraphs by doing so (admittedly, I hardly ever do this – how about you?). https://ay-up.com/

  3. photographer より:

    And if you are not aware about the number of
    designs out there then you’ll most definitely not order the picture frame that may make the images of
    a baby look lovely. Take for instance the picture
    body and the gradual conversion to the digital frame, and the
    added complications it has added to our lives.
    You probably have a actually impressive sky, it can be effective to let the sky fill the frame as a lot as
    attainable. You possibly can mount any such camera on any type
    of flat floor. SuperSprint wrote: Actually obtained sensor on the street before the camera about 100m away.
    I used to be driving down a country road alone and seemed
    to my left and saw this picture. Tripods and image stabilization are helpful (but not vital) for capturing clear photographs of flowers.
    Another favorite topic for nature photographers is flowers.
    His first activity will likely be to cover the subject of his venture and then solely he can repair his shoot. https://mondino-update.net

  4. Autos より:

    – Ottaa bulldoggitapaamiset auto. – Joo. https://dallasimports.net/

  5. the supplement and the complement より:

    My name is Muoi Fuller but everybody calls me Muoi. I’m from
    United States. I’m studying at the high school (final year) and I play the Guitar for
    6 years. Usually I choose music from the famous films ;
    ).
    I have two sister. I love Color Guard, watching TV (The Big Bang Theory) and Urban exploration. https://tinyurl.com/y3ncs89z

  6. João Vitor より:

    A ejaculação precoce é uma queixa sexual corriqueiro. https://foursquare.com/user/505741062

  7. prestamos urgentes sin buro de credito より:

    Nuestro proceso de préstamo se puede completar 100% online sin necesidad
    de visitar una sucursal , incluso sin tener que levantarte de la cama. http://85.214.121.189/forum/entry.php?63618-Pr%E9stamos-Inmediatos-CreditosInmediatos-com-mx

  8. perfect venue より:

    Good web siote you have here.. It’s dikfficult tto
    find quality writing like yours these days. I seriously appreciate people like you!
    Take care!! http://www.blackplanet.com/your_page/blog/view_posting.html?pid=8052894&profile_id=63253117&profile_name=momentousfan9322&user_id=63253117&username=momentousfan9322

  9. prestamos inmediatos cuernavaca より:

    Puedes ahorrar mucho tiempo, ya que no deberás visitar los sitios de de préstamos pefsonales
    inmediatos una por una. http://85.214.121.189/forum/entry.php?25481-Prestamos-Hipotecarios-Inmediatos

  10. como crescer rapido より:

    Continuamente com um pouco de água quente, você pode fazer
    enquanto você tomar banho, para penetrar na pele melhor. http://ksxtxh.cirea.net.cn/discuz/home.php?mod=space&uid=317732&do=profile&from=space

  11. Rowena より:

    Asegurate de informarte y conocer las mejores opciones en préstamos
    en línea sin buró dee crédito y beneficiate de esta excelente herramienta financiera. http://dienthoaisimso.com/entries/4194-angel-Guimera-12-BAJO.html

  12. hormone booster より:

    Many thanks for the share. I hope a great deal
    of other viewers liked your article as well. https://www.wattpad.com/414854346-the-best-ways-to-obtain-your-male-health-back-in

コメントを残す