corrected typo
This commit is contained in:
@@ -1345,13 +1345,13 @@ In order to find the derivative of <span class="math notranslate nohighlight">\(
|
||||
\[
|
||||
\alpha = \boldsymbol{z}^T\boldsymbol{x},
|
||||
\]</div>
|
||||
<p>which means that (using our previous example) we have</p>
|
||||
<p>which means that (using our previous example and keeping track of our definition of the derivative of a scalar) we have</p>
|
||||
<div class="math notranslate nohighlight">
|
||||
\[
|
||||
\frac{\partial \alpha}{\partial \boldsymbol{x}} = \boldsymbol{z}=\boldsymbol{A}^T\boldsymbol{y}.
|
||||
\frac{\partial \alpha}{\partial \boldsymbol{x}} = \frac{\partial \boldsymbol{z}^T\boldsymbol{x}}{\partial \boldsymbol{x}}=\boldsymbol{z}^T=\boldsymbol{A}^T\boldsymbol{y}.
|
||||
\]</div>
|
||||
<p>Note that the resulting vector elements are the same for <span class="math notranslate nohighlight">\(\boldsymbol{z}^T\)</span> and <span class="math notranslate nohighlight">\(\boldsymbol{z}\)</span>, the only difference is that one is just the transpose of the other.</p>
|
||||
<p>Since <span class="math notranslate nohighlight">\(\alpha\)</span> is a scalar we have <span class="math notranslate nohighlight">\(\alpha =\alpha^T=\boldsymbol{x}^T\boldsymbol{A}^T\boldsymbol{y}\)</span>. Defining now <span class="math notranslate nohighlight">\(\boldsymbol{z}=\boldsymbol{x}^T\boldsymbol{A}^T\)</span> we find that</p>
|
||||
<p>Since <span class="math notranslate nohighlight">\(\alpha\)</span> is a scalar we have <span class="math notranslate nohighlight">\(\alpha =\alpha^T=\boldsymbol{x}^T\boldsymbol{A}^T\boldsymbol{y}\)</span>. Defining now <span class="math notranslate nohighlight">\(\boldsymbol{z}^T=\boldsymbol{x}^T\boldsymbol{A}^T\)</span> we find that</p>
|
||||
<div class="math notranslate nohighlight">
|
||||
\[
|
||||
\frac{\partial \alpha}{\partial \boldsymbol{y}} = \boldsymbol{z}^T=\boldsymbol{x}^T\boldsymbol{A}^T.
|
||||
@@ -1471,7 +1471,11 @@ C(\boldsymbol{\beta})=\frac{1}{n}\boldsymbol{w}^T\boldsymbol{w},
|
||||
<p>We list here some other useful relations we may encounter (recall that vectors are defined by boldfaced low-key letters)</p>
|
||||
<div class="math notranslate nohighlight">
|
||||
\[
|
||||
\frac{\partial (\boldsymbol{b}^T\boldsymbol{a})}{\partial \boldsymbol{a}} = \boldsymbol{b},
|
||||
\frac{\partial (\boldsymbol{x}^T\boldsymbol{a})}{\partial \boldsymbol{x}} = \boldsymbol{a}^T,
|
||||
\]</div>
|
||||
<div class="math notranslate nohighlight">
|
||||
\[
|
||||
\frac{\partial (\boldsymbol{a}^T\boldsymbol{x})}{\partial \boldsymbol{x}} = \boldsymbol{a}^T,
|
||||
\]</div>
|
||||
<div class="math notranslate nohighlight">
|
||||
\[
|
||||
@@ -1593,7 +1597,7 @@ Since we are not using <strong>Scikit-Learn</strong> here we can define our own
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.995597266739957
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.9949937802432685
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1610,7 +1614,7 @@ Since we are not using <strong>Scikit-Learn</strong> here we can define our own
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.007984802498580442
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.01027999506395317
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1625,23 +1629,23 @@ Since we are not using <strong>Scikit-Learn</strong> here we can define our own
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[0.00320321 0.00245758 0.05081566 0.0019973 0.00120436 0.0178182
|
||||
0.00900007 0.00408859 0.00048748 0.00486475 0.01992842 0.00354541
|
||||
0.02097611 0.02124814 0.05100557 0.03342039 0.01004759 0.03045198
|
||||
0.01334173 0.02570599 0.01152362 0.0055851 0.01331589 0.00670173
|
||||
0.00111016 0.00674891 0.02190496 0.01318991 0.01012542 0.00536771
|
||||
0.01056529 0.03104011 0.02194347 0.00570653 0.02260804 0.00449913
|
||||
0.01584232 0.00856436 0.01271496 0.02217472 0.00201728 0.00743189
|
||||
0.03465345 0.01961887 0.00071763 0.05253796 0.00713411 0.02597965
|
||||
0.00044036 0.04210928 0.04276324 0.01934278 0.03413554 0.03117346
|
||||
0.01696872 0.0103092 0.05179687 0.03101773 0.00419078 0.04059438
|
||||
0.0681795 0.02798066 0.01269201 0.00019982 0.00546406 0.01333519
|
||||
0.00925952 0.06136355 0.05846851 0.03697739 0.04446751 0.0707621
|
||||
0.02017735 0.01044641 0.06713371 0.01791265 0.05612456 0.02375823
|
||||
0.0050523 0.03568016 0.00771754 0.01959569 0.00679037 0.01420455
|
||||
0.09201618 0.01115073 0.00372262 0.03688621 0.05250129 0.00520339
|
||||
0.00423753 0.00267063 0.0575829 0.00228698 0.00253137 0.0280728
|
||||
0.01264352 0.01788241 0.07061848 0.00521152]
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[0.00436097 0.05486516 0.0284569 0.03042532 0.05255806 0.00279707
|
||||
0.02052907 0.02230304 0.04049356 0.04875464 0.0571849 0.01328032
|
||||
0.00537238 0.05368812 0.01718359 0.00919685 0.01370514 0.01506857
|
||||
0.03391617 0.01736839 0.01644373 0.01853101 0.00043401 0.0501397
|
||||
0.01655376 0.01410563 0.00248515 0.06472468 0.01025732 0.04921476
|
||||
0.00377783 0.01632149 0.0267125 0.05363498 0.00438551 0.00650452
|
||||
0.02410491 0.05852079 0.02783602 0.05441837 0.009371 0.01651438
|
||||
0.01887299 0.04798291 0.01970507 0.05486379 0.01445124 0.06584783
|
||||
0.00363331 0.02765621 0.05439747 0.02002135 0.00886469 0.01777143
|
||||
0.03649344 0.03241934 0.02896611 0.00248403 0.06486283 0.01642653
|
||||
0.04926154 0.00057042 0.0008744 0.02936993 0.03010304 0.01815639
|
||||
0.04037945 0.00553874 0.00223388 0.01474277 0.06839199 0.0306628
|
||||
0.01057262 0.04008416 0.0391324 0.0350905 0.03760958 0.0193714
|
||||
0.0201182 0.00557755 0.04383596 0.02646579 0.02413829 0.00946466
|
||||
0.01335463 0.0125267 0.00971419 0.06107268 0.02539264 0.0227732
|
||||
0.00396906 0.02333106 0.00192092 0.02267534 0.00241645 0.00636841
|
||||
0.02635071 0.03800193 0.04967168 0.00836194]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1710,15 +1714,15 @@ but now splitting the data into a training set and a test set.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[ 2.032142 0.27650047 3.22178183 2.62592637 -1.1157376 ]
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[ 1.96008541 0.31597257 4.77260857 -0.39452621 0.29176118]
|
||||
Training R2
|
||||
0.994910550643694
|
||||
0.9958819974114181
|
||||
Training MSE
|
||||
0.011016261190269798
|
||||
0.00866641755559425
|
||||
Test R2
|
||||
0.9949909770903465
|
||||
0.9901527242749735
|
||||
Test MSE
|
||||
0.007328424743352142
|
||||
0.020056422754215136
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2276,7 +2280,7 @@ the aims is to reproduce Figure 2.11 of <a class="reference external" href="http
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<img alt="_images/week35_146_0.png" src="_images/week35_146_0.png" />
|
||||
<img alt="_images/week35_147_0.png" src="_images/week35_147_0.png" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2677,7 +2681,7 @@ MSE with Sklearn intercept
|
||||
0.004113634617443131
|
||||
</pre></div>
|
||||
</div>
|
||||
<img alt="_images/week35_181_1.png" src="_images/week35_181_1.png" />
|
||||
<img alt="_images/week35_182_1.png" src="_images/week35_182_1.png" />
|
||||
</div>
|
||||
</div>
|
||||
<p>The intercept is the value of our output/target variable
|
||||
|
||||
Reference in New Issue
Block a user