{"id":47,"date":"2017-07-21T04:16:49","date_gmt":"2017-07-20T19:16:49","guid":{"rendered":"http:\/\/www.naru.jpn.com\/wordpress\/?p=47"},"modified":"2017-12-25T09:04:25","modified_gmt":"2017-12-25T00:04:25","slug":"%e6%ad%a3%e8%a6%8f%e6%96%b9%e7%a8%8b%e5%bc%8f%e3%81%ae%e9%80%a3%e7%ab%8b%e5%81%8f%e5%be%ae%e5%88%86%e6%96%b9%e7%a8%8b%e5%bc%8f%e3%81%8b%e3%82%89%e3%81%ae%e5%b0%8e%e5%87%ba","status":"publish","type":"post","link":"https:\/\/naru.jpn.com\/wordpress\/?p=47","title":{"rendered":"\u6b63\u898f\u65b9\u7a0b\u5f0f\u306e\u9023\u7acb\u504f\u5fae\u5206\u65b9\u7a0b\u5f0f\u304b\u3089\u306e\u5c0e\u51fa"},"content":{"rendered":"<p>\u6700\u8fd1 Andrew Ng \u306e\u6a5f\u68b0\u5b66\u7fd2\u306e\u8b1b\u5ea7\u3092\u898b\u3066\u3044\u307e\u3059. \u76ee\u7684\u95a2\u6570\u3068\u6700\u6025\u964d\u4e0b\u6cd5\u306e\u8aac\u660e\u306f\u4e01\u5be7\u3067\u3057\u305f\u304c, \u6b63\u898f\u65b9\u7a0b\u5f0f(Normal equation)\u306e\u7d39\u4ecb\u306f\u5510\u7a81\u611f\u304c\u3042\u308a\u307e\u3057\u305f. \u6b63\u898f\u65b9\u7a0b\u5f0f\u306e\u8868\u5f0f\u3092, \u6700\u6025\u964d\u4e0b\u6cd5\u3067\u4f7f\u308f\u308c\u3066\u3044\u305f\u9023\u7acb\u504f\u5fae\u5206\u65b9\u7a0b\u5f0f\u304b\u3089\u5c0e\u3044\u3066\u307f\u307e\u3059.<\/p>\n<p><!--more--><\/p>\n<p class=\"article_subtitle\">\u76ee\u7684<\/p>\n<p>\u8868\u5f0f<\/p>\n<p>\\[<br \/>\n\\theta = (X^{\\mathrm{T}} X )^{-1} X^{\\mathrm{T}} y<br \/>\n\\]<\/p>\n<p>\u3092\u5c0e\u304f.<\/p>\n<p class=\"article_subtitle\">\u524d\u63d0<\/p>\n<p>\u76ee\u7684\u95a2\u6570\u3068\u3057\u3066,<\/p>\n<p>\\[<br \/>\nJ(\\theta) = \\frac{1}{2m}\\sum_{i=1}^{m}\\left( h_{\\theta}(x^{(i)}) &#8211; y^{(i)} \\right)^{2}, ~~~h_{\\theta}(x^{(i)}) = \\sum_{k=0}^{n}\\theta_{k}x_{k}^{(i)}<br \/>\n\\]<\/p>\n<p>\u3092\u8003\u3048\u308b. \\(J(\\theta)\\) \u3092\u5c0f\u3055\u304f\u3059\u308b \\(\\theta\\) \u306e\u7d44\u3092\u898b\u3064\u3051\u305f\u3044. \u6700\u6025\u964d\u4e0b\u6cd5\u3067\u306f, \\(J(\\theta)\\) \u304c\u6975\u5c0f\u5024\u3092\u3068\u308b\u3088\u3046\u306a\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u63a2\u3057\u3066\u3044\u304f\u306e\u3060\u3063\u305f. \u4f8b\u3048\u3070, \\(\\theta_{j}\\) \u306b\u3064\u3044\u3066\u306f,<\/p>\n<p>\\[<br \/>\n\\frac{\\partial J(\\theta)}{\\partial\\theta_{j}} = 0<br \/>\n\\]<\/p>\n<p>\u3068\u306a\u308b\u3088\u3046\u306a \\(\\theta_{j}\\) \u3092\u8a08\u7b97\u3059\u308b. \u5168\u3066\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3064\u3044\u3066, \u540c\u6642\u306b\u6975\u5c0f\u5024\u3092\u3068\u308b\u3088\u3046\u306a \\(\\theta\\) \u3092\u898b\u3064\u3051\u305f\u3044.<\/p>\n<p>\\[<br \/>\n\\begin{eqnarray}<br \/>\n\\left\\{<br \/>\n\\begin{array}{l}<br \/>\n\\displaystyle \\frac{\\partial J(\\theta)}{\\partial\\theta_{0}} = 0 \\\\<br \/>\n\\displaystyle \\frac{\\partial J(\\theta)}{\\partial\\theta_{1}} = 0\u3000\\tag{1} \\\\<br \/>\n\\displaystyle \\vdots \\\\<br \/>\n\\displaystyle \\frac{\\partial J(\\theta)}{\\partial\\theta_{n}} = 0<br \/>\n\\end{array}<br \/>\n\\right.<br \/>\n\\end{eqnarray}<br \/>\n\\]<\/p>\n<p class=\"article_subtitle\">\u504f\u5fae\u5206\u65b9\u7a0b\u5f0f\u306e\u5c55\u958b<\/p>\n<p>(1)\u5f0f\u3067\\(\\theta_{j}\\)\u306b\u3064\u3044\u3066\u8003\u3048, \u5f0f\u3092\u5c55\u958b\u3057\u3066\u3044\u304f.<\/p>\n<p>\\[<br \/>\n\\begin{array}{rcl}<br \/>\n\\displaystyle \\frac{\\partial J(\\theta)}{\\partial\\theta_{j}} &amp;=&amp; \\displaystyle \\frac{1}{2m}\\frac{\\partial}{\\partial\\theta_{j}}\\sum_{i=1}^{m}\\left( h_{\\theta}(x^{(i)}) &#8211; y^{(i)} \\right)^{2} \\\\<br \/>\n&amp;=&amp; \\displaystyle \\frac{1}{2m}\\sum_{i=1}^{m} \\frac{\\partial}{\\partial\\theta_{j}} \\left( h_{\\theta}(x^{(i)}) &#8211; y^{(i)} \\right)^{2} \\\\<br \/>\n&amp;=&amp; \\displaystyle \\frac{1}{2m}\\sum_{i=1}^{m} 2 \\left( h_{\\theta}(x^{(i)}) &#8211; y^{(i)} \\right) x_{j}^{(i)} \\\\<br \/>\n&amp;=&amp; \\displaystyle \\frac{1}{m}\\sum_{i=1}^{m} \\left( h_{\\theta}(x^{(i)}) &#8211; y^{(i)} \\right) x_{j}^{(i)} \\\\<br \/>\n&amp;=&amp; \\displaystyle \\frac{1}{m} \\left( \\underline{\\sum_{i=1}^{m} h_{\\theta}(x^{(i)}) x_{j}^{(i)}}_{(\\beta)} &#8211; \\underline{\\sum_{i=1}^{m} y^{(i)} x_{j}^{(i)}}_{(\\alpha)} \\right) \\tag{2} \\\\<br \/>\n\\end{array}<br \/>\n\\]<\/p>\n<p>\u305f\u3060\u3057,<\/p>\n<p>\\[<br \/>\n\\frac{\\partial}{\\partial\\theta_{j}} h_{\\theta}(x^{(i)}) = \\frac{\\partial}{\\partial\\theta_{j}} \\left( \\theta_{0}x_{0} + \\theta_{1}x_{1} + \\cdots + \\theta_{n}x_{n} \\right) = x_{j}^{(i)}<br \/>\n\\]<\/p>\n<p>\u306a\u306e\u3067<\/p>\n<p>\\[<br \/>\n\\frac{\\partial}{\\partial\\theta_{j}} \\left( h_{\\theta}(x^{(i)}) &#8211; y^{(i)} \\right)^{2} = 2 \\left( h_{\\theta}(x^{(i)}) &#8211; y^{(i)} \\right) x_{j}^{(i)}<br \/>\n\\]<\/p>\n<p>\u3068\u306a\u308b\u3053\u3068\u3092\u7528\u3044\u3066\u3044\u308b.<\/p>\n<p>(1)\u5f0f\u3088\u308a \\(\\frac{\\partial J(\\theta)}{\\partial\\theta_{j}} = 0\\) \u3067\u3042\u308b\u304b\u3089, \\(\\theta_{j}\\)\u306b\u3064\u3044\u3066<\/p>\n<p>\\[<br \/>\n\\sum_{i=1}^{m} h_{\\theta}(x^{(i)}) x_{j}^{(i)} &#8211; \\sum_{i=1}^{m} y^{(i)} x_{j}^{(i)} = 0 \\tag{3}<br \/>\n\\]<\/p>\n<p>\u304c\u6210\u308a\u7acb\u3064.<\/p>\n<p class=\"article_subtitle\">\u548c\u306e\u90e8\u5206\u306e\u884c\u5217\u8868\u73fe<\/p>\n<p>(2)\u5f0f\u4e2d\u306e\u4e0b\u7dda\u90e8 \\((\\alpha)\\) \u306b\u3064\u3044\u3066\u8003\u3048\u308b. \\(i\\) \u306b\u3064\u3044\u3066\u306e\u548c\u3092\u3042\u3089\u308f\u306b\u66f8\u304f\u3068.<\/p>\n<p>\\[<br \/>\n(\\alpha) = \\sum_{i=1}^{m} y^{(i)} x_{j}^{(i)} = x_{j}^{1}y^{1} + x_{j}^{2}y^{2} + \\cdots + x_{j}^{m}y^{m}<br \/>\n\\]<\/p>\n<p>\u3068\u306a\u308a, \u3053\u308c\u306f\u884c\u5217\u3067<\/p>\n<p>\\[<br \/>\n\\begin{pmatrix} x_{j}^{1} &amp; x_{j}^{2} &amp; \\cdots &amp; x_{j}^{m} \\end{pmatrix} \\begin{pmatrix} y^{1} \\\\ y^{2} \\\\ \\vdots \\\\ y^{m} \\end{pmatrix} \\tag{4}<br \/>\n\\]<\/p>\n<p>\u3068\u66f8\u3051\u308b. \u4e0b\u7dda\u90e8 \\((\\beta)\\) \u306b\u3064\u3044\u3066\u3082, \u6dfb\u3048\u5b57\u306b\u6ce8\u610f\u3057\u3066\u540c\u69d8\u306b\u548c\u3092\u5c55\u958b\u3057\u3066\u3044\u304f\u3068,<\/p>\n<p>\\[<br \/>\n\\begin{array}{rcl}<br \/>\n(\\beta) &amp;=&amp; \\displaystyle \\sum_{i=1}^{m} h_{\\theta}(x^{(i)}) x_{j}^{(i)} \\\\<br \/>\n&amp;=&amp; \\displaystyle \\sum_{i=1}^{m} \\left( \\sum_{k=0}^{n}\\theta_{k}x_{k}^{(i)} \\right) x_{j}^{(i)} \\\\<br \/>\n&amp;=&amp; \\displaystyle \\sum_{i=1}^{m} \\left( \\theta_{0}x_{0}^{(i)} + \\theta_{1}x_{1}^{(i)} + \\cdots + \\theta_{n}x_{n}^{(i)} \\right) x_{j}^{(i)} \\\\<br \/>\n&amp;=&amp; \\displaystyle \\left( \\theta_{0}x_{0}^{(1)} + \\theta_{1}x_{1}^{(1)} + \\cdots + \\theta_{n}x_{n}^{(1)} \\right) x_{j}^{(1)} + \\left( \\theta_{0}x_{0}^{(2)} + \\theta_{1}x_{1}^{(2)} + \\cdots + \\theta_{n}x_{n}^{(2)} \\right) x_{j}^{(2)} + \\left( \\theta_{0}x_{0}^{(m)} + \\theta_{1}x_{1}^{(m)} + \\cdots + \\theta_{n}x_{n}^{(m)} \\right) x_{j}^{(m)}<br \/>\n\\end{array}<br \/>\n\\]<\/p>\n<p>\u3068\u306a\u308a, \u3053\u308c\u306f\u884c\u5217\u3067<\/p>\n<p>\\[<br \/>\n\\begin{pmatrix} x_{j}^{(1)} &amp; x_{j}^{(2)} &amp; \\cdots &amp; x_{j}^{(m)} \\end{pmatrix} \\begin{pmatrix} x_{0}^{(1)} &amp; x_{1}^{(1)} &amp; \\cdots &amp; x_{n}^{(1)} \\\\ x_{0}^{(2)} &amp; x_{1}^{(2)} &amp; \\cdots &amp; x_{n}^{(2)} \\\\ \\vdots &amp; \\ddots &amp; \\vdots &amp; \\vdots \\\\ x_{0}^{(m)} &amp; x_{1}^{(m)} &amp; \\cdots &amp; x_{n}^{(m)} \\end{pmatrix} \\begin{pmatrix} \\theta_{0} \\\\ \\theta_{1} \\\\ \\vdots \\\\ \\theta_{n} \\end{pmatrix} \\tag{5}<br \/>\n\\]<\/p>\n<p>\u3068\u66f8\u3051\u308b.<\/p>\n<p>(3),(4),(5)\u5f0f\u304b\u3089, \\(\\theta_{j}\\)\u306b\u3064\u3044\u3066,<\/p>\n<p>\\[<br \/>\n\\begin{pmatrix} x_{j}^{(1)} &amp; x_{j}^{(2)} &amp; \\cdots &amp; x_{j}^{(m)} \\end{pmatrix} \\begin{pmatrix} x_{0}^{(1)} &amp; x_{1}^{(1)} &amp; \\cdots &amp; x_{n}^{(1)} \\\\ x_{0}^{(2)} &amp; x_{1}^{(2)} &amp; \\cdots &amp; x_{n}^{(2)} \\\\ \\vdots &amp; \\ddots &amp; \\vdots &amp; \\vdots \\\\ x_{0}^{(m)} &amp; x_{1}^{(m)} &amp; \\cdots &amp; x_{n}^{(m)} \\end{pmatrix} \\begin{pmatrix} \\theta_{0} \\\\ \\theta_{1} \\\\ \\vdots \\\\ \\theta_{n} \\end{pmatrix} ~-~<br \/>\n\\begin{pmatrix} x_{j}^{1} &amp; x_{j}^{2} &amp; \\cdots &amp; x_{j}^{m} \\end{pmatrix} \\begin{pmatrix} y^{1} \\\\ y^{2} \\\\ \\vdots \\\\ y^{m} \\end{pmatrix} = 0 \\tag{6}<br \/>\n\\]<\/p>\n<p>\u3068\u306a\u308b.<\/p>\n<p class=\"article_subtitle\">\u518d\u3073, \u9023\u7acb<\/p>\n<p>\\(\\theta_{0}\\)\u306b\u3064\u3044\u3066\u8003\u3048\u308b\u3068, (6)\u5f0f\u3092\u53c2\u8003\u306b\u3057\u3066<\/p>\n<p>\\[<br \/>\n\\begin{pmatrix} x_{0}^{(1)} &amp; x_{0}^{(2)} &amp; \\cdots &amp; x_{0}^{(m)} \\end{pmatrix} \\begin{pmatrix} x_{0}^{(1)} &amp; x_{1}^{(1)} &amp; \\cdots &amp; x_{n}^{(1)} \\\\ x_{0}^{(2)} &amp; x_{1}^{(2)} &amp; \\cdots &amp; x_{n}^{(2)} \\\\ \\vdots &amp; \\ddots &amp; \\vdots &amp; \\vdots \\\\ x_{0}^{(m)} &amp; x_{1}^{(m)} &amp; \\cdots &amp; x_{n}^{(m)} \\end{pmatrix} \\begin{pmatrix} \\theta_{0} \\\\ \\theta_{1} \\\\ \\vdots \\\\ \\theta_{n} \\end{pmatrix} ~-~<br \/>\n\\begin{pmatrix} x_{j}^{1} &amp; x_{j}^{2} &amp; \\cdots &amp; x_{j}^{m} \\end{pmatrix} \\begin{pmatrix} y^{1} \\\\ y^{2} \\\\ \\vdots \\\\ y^{m} \\end{pmatrix} = 0<br \/>\n\\]<\/p>\n<p>\u3067\u3042\u308b\u304c, \u3053\u3053\u3067\u5404\u9805\u306e\u5de6\u7aef\u306e\u884c\u5217\u306e\u5f62\u5f0f\u3092\u5909\u3048\u308b.<\/p>\n<p>\\[<br \/>\n\\begin{pmatrix} x_{0}^{(1)} &amp; x_{0}^{(2)} &amp; \\cdots &amp; x_{0}^{(m)} \\\\ 0 &amp; 0 &amp; \\cdots &amp; 0 \\\\ \\vdots &amp; \\ddots &amp; \\vdots &amp; \\vdots \\\\ 0 &amp; 0 &amp; \\cdots &amp; 0 \\end{pmatrix} \\begin{pmatrix} x_{0}^{(1)} &amp; x_{1}^{(1)} &amp; \\cdots &amp; x_{n}^{(1)} \\\\ x_{0}^{(2)} &amp; x_{1}^{(2)} &amp; \\cdots &amp; x_{n}^{(2)} \\\\ \\vdots &amp; \\ddots &amp; \\vdots &amp; \\vdots \\\\ x_{0}^{(m)} &amp; x_{1}^{(m)} &amp; \\cdots &amp; x_{n}^{(m)} \\end{pmatrix} \\begin{pmatrix} \\theta_{0} \\\\ \\theta_{1} \\\\ \\vdots \\\\ \\theta_{n} \\end{pmatrix} ~-~<br \/>\n\\begin{pmatrix} x_{0}^{(1)} &amp; x_{0}^{(2)} &amp; \\cdots &amp; x_{0}^{(m)} \\\\ 0 &amp; 0 &amp; \\cdots &amp; 0 \\\\ \\vdots &amp; \\ddots &amp; \\vdots &amp; \\vdots \\\\ 0 &amp; 0 &amp; \\cdots &amp; 0 \\end{pmatrix} \\begin{pmatrix} y^{1} \\\\ y^{2} \\\\ \\vdots \\\\ y^{m} \\end{pmatrix} = 0<br \/>\n\\]<\/p>\n<p>\\(\\theta_{1}\\), \\(\\theta_{n}\\) \u306b\u3064\u3044\u3066\u306f\u305d\u308c\u305e\u308c\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3059\u308b.<\/p>\n<p>\\[<br \/>\n\\begin{pmatrix} 0 &amp; 0 &amp; \\cdots &amp; 0 \\\\ x_{1}^{(1)} &amp; x_{1}^{(2)} &amp; \\cdots &amp; x_{1}^{(m)} \\\\ \\vdots &amp; \\ddots &amp; \\vdots &amp; \\vdots \\\\ 0 &amp; 0 &amp; \\cdots &amp; 0 \\end{pmatrix} \\begin{pmatrix} x_{0}^{(1)} &amp; x_{1}^{(1)} &amp; \\cdots &amp; x_{n}^{(1)} \\\\ x_{0}^{(2)} &amp; x_{1}^{(2)} &amp; \\cdots &amp; x_{n}^{(2)} \\\\ \\vdots &amp; \\ddots &amp; \\vdots &amp; \\vdots \\\\ x_{0}^{(m)} &amp; x_{1}^{(m)} &amp; \\cdots &amp; x_{n}^{(m)} \\end{pmatrix} \\begin{pmatrix} \\theta_{0} \\\\ \\theta_{1} \\\\ \\vdots \\\\ \\theta_{n} \\end{pmatrix} ~-~<br \/>\n\\begin{pmatrix} 0 &amp; 0 &amp; \\cdots &amp; 0 \\\\ x_{1}^{(1)} &amp; x_{1}^{(2)} &amp; \\cdots &amp; x_{1}^{(m)} \\\\ \\vdots &amp; \\ddots &amp; \\vdots &amp; \\vdots \\\\ 0 &amp; 0 &amp; \\cdots &amp; 0 \\end{pmatrix} \\begin{pmatrix} y^{1} \\\\ y^{2} \\\\ \\vdots \\\\ y^{m} \\end{pmatrix} = 0<br \/>\n\\]<\/p>\n<p>\\[<br \/>\n\\begin{pmatrix} 0 &amp; 0 &amp; \\cdots &amp; 0 \\\\ 0 &amp; 0 &amp; \\cdots &amp; 0 \\\\ \\vdots &amp; \\ddots &amp; \\vdots &amp; \\vdots \\\\ x_{n}^{(1)} &amp; x_{n}^{(2)} &amp; \\cdots &amp; x_{n}^{(m)} \\end{pmatrix} \\begin{pmatrix} x_{0}^{(1)} &amp; x_{1}^{(1)} &amp; \\cdots &amp; x_{n}^{(1)} \\\\ x_{0}^{(2)} &amp; x_{1}^{(2)} &amp; \\cdots &amp; x_{n}^{(2)} \\\\ \\vdots &amp; \\ddots &amp; \\vdots &amp; \\vdots \\\\ x_{0}^{(m)} &amp; x_{1}^{(m)} &amp; \\cdots &amp; x_{n}^{(m)} \\end{pmatrix} \\begin{pmatrix} \\theta_{0} \\\\ \\theta_{1} \\\\ \\vdots \\\\ \\theta_{n} \\end{pmatrix} ~-~<br \/>\n\\begin{pmatrix} 0 &amp; 0 &amp; \\cdots &amp; 0 \\\\ 0 &amp; 0 &amp; \\cdots &amp; 0 \\\\ \\vdots &amp; \\ddots &amp; \\vdots &amp; \\vdots \\\\ x_{n}^{(1)} &amp; x_{n}^{(2)} &amp; \\cdots &amp; x_{n}^{(m)} \\end{pmatrix} \\begin{pmatrix} y^{1} \\\\ y^{2} \\\\ \\vdots \\\\ y^{m} \\end{pmatrix} = 0<br \/>\n\\]<\/p>\n<p>\u3053\u308c\u3089\u3092\u9023\u7acb\u3055\u305b\u3066\u8db3\u3057\u5408\u308f\u305b\u308b\u3053\u3068\u3067, \u4ee5\u4e0b\u306e\u5f0f\u3092\u5f97\u308b.<\/p>\n<p>\\[<br \/>\n\\begin{pmatrix} x_{0}^{(1)} &amp; x_{0}^{(2)} &amp; \\cdots &amp; x_{0}^{(m)} \\\\ x_{1}^{(1)} &amp; x_{1}^{(2)} &amp; \\cdots &amp; x_{1}^{(m)} \\\\ \\vdots &amp; \\ddots &amp; \\vdots &amp; \\vdots \\\\ x_{n}^{(1)} &amp; x_{n}^{(2)} &amp; \\cdots &amp; x_{n}^{(m)} \\end{pmatrix} \\begin{pmatrix} x_{0}^{(1)} &amp; x_{1}^{(1)} &amp; \\cdots &amp; x_{n}^{(1)} \\\\ x_{0}^{(2)} &amp; x_{1}^{(2)} &amp; \\cdots &amp; x_{n}^{(2)} \\\\ \\vdots &amp; \\ddots &amp; \\vdots &amp; \\vdots \\\\ x_{0}^{(m)} &amp; x_{1}^{(m)} &amp; \\cdots &amp; x_{n}^{(m)} \\end{pmatrix} \\begin{pmatrix} \\theta_{0} \\\\ \\theta_{1} \\\\ \\vdots \\\\ \\theta_{n} \\end{pmatrix} ~-~<br \/>\n\\begin{pmatrix} x_{0}^{(1)} &amp; x_{0}^{(2)} &amp; \\cdots &amp; x_{0}^{(m)} \\\\ x_{1}^{(1)} &amp; x_{1}^{(2)} &amp; \\cdots &amp; x_{1}^{(m)} \\\\ \\vdots &amp; \\ddots &amp; \\vdots &amp; \\vdots \\\\ x_{n}^{(1)} &amp; x_{n}^{(2)} &amp; \\cdots &amp; x_{n}^{(m)} \\end{pmatrix} \\begin{pmatrix} y^{1} \\\\ y^{2} \\\\ \\vdots \\\\ y^{m} \\end{pmatrix} = 0 \\tag{7}<br \/>\n\\]<\/p>\n<p class=\"article_subtitle\">\u6b63\u898f\u65b9\u7a0b\u5f0f\u306e\u8868\u5f0f<\/p>\n<p>\\(X\\), \\(\\theta\\), \\(y\\) \u3092\u5b9a\u7fa9\u3059\u308b.<\/p>\n<p>\\[<br \/>\nX = \\begin{pmatrix} x_{0}^{(1)} &amp; x_{1}^{(1)} &amp; \\cdots &amp; x_{n}^{(1)} \\\\ x_{0}^{(2)} &amp; x_{1}^{(2)} &amp; \\cdots &amp; x_{n}^{(2)} \\\\ \\vdots &amp; \\ddots &amp; \\vdots &amp; \\vdots \\\\ x_{0}^{(m)} &amp; x_{1}^{(m)} &amp; \\cdots &amp; x_{n}^{(m)} \\end{pmatrix}<br \/>\n\\]<\/p>\n<p>\\[<br \/>\n\\theta = \\begin{pmatrix} \\theta_{0} \\\\ \\theta_{1} \\\\ \\vdots \\\\ \\theta_{n} \\end{pmatrix}<br \/>\n\\]<\/p>\n<p>\\[<br \/>\ny = \\begin{pmatrix} y^{1} \\\\ y^{2} \\\\ \\vdots \\\\ y^{m} \\end{pmatrix}<br \/>\n\\]<\/p>\n<p>(7)\u5f0f\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u308b.<\/p>\n<p>\\[<br \/>\nX^{\\mathrm{T}} X \\theta &#8211; X^{\\mathrm{T}} y = 0<br \/>\n\\]<\/p>\n<p>\\(X^{\\mathrm{T}} X\\) \u306e(\u4e00\u822c)\u9006\u884c\u5217\u3092\u5de6\u304b\u3089\u639b\u3051\u308b.<\/p>\n<p>\\[<br \/>\n\\theta = (X^{\\mathrm{T}} X )^{-1} X^{\\mathrm{T}} y<br \/>\n\\]<\/p>\n<p>\u76ee\u7684\u306e\u8868\u5f0f\u3092\u5f97\u305f.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1 Andrew Ng \u306e\u6a5f\u68b0\u5b66\u7fd2\u306e\u8b1b\u5ea7\u3092\u898b\u3066\u3044\u307e\u3059. \u76ee\u7684\u95a2\u6570\u3068\u6700\u6025\u964d\u4e0b\u6cd5\u306e\u8aac\u660e\u306f\u4e01\u5be7\u3067\u3057\u305f\u304c, \u6b63\u898f\u65b9\u7a0b\u5f0f(Normal equation)\u306e\u7d39\u4ecb\u306f\u5510\u7a81\u611f\u304c\u3042\u308a\u307e\u3057\u305f. \u6b63\u898f\u65b9\u7a0b\u5f0f\u306e\u8868\u5f0f\u3092, \u6700\u6025\u964d\u4e0b\u6cd5\u3067\u4f7f\u308f\u308c\u3066\u3044 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2,3],"tags":[],"_links":{"self":[{"href":"https:\/\/naru.jpn.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/47"}],"collection":[{"href":"https:\/\/naru.jpn.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/naru.jpn.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/naru.jpn.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/naru.jpn.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=47"}],"version-history":[{"count":100,"href":"https:\/\/naru.jpn.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/47\/revisions"}],"predecessor-version":[{"id":159,"href":"https:\/\/naru.jpn.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/47\/revisions\/159"}],"wp:attachment":[{"href":"https:\/\/naru.jpn.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=47"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/naru.jpn.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=47"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/naru.jpn.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=47"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}