This commit is contained in:
Morten Hjorth-Jensen
2024-09-22 21:21:59 +02:00
parent 0a6ba7c08d
commit 80f0f2ffab
102 changed files with 18315 additions and 2027 deletions
+40 -30
View File
@@ -298,6 +298,16 @@ const thebe_selector_output = ".output, .cell_output"
Week 38: Logistic Regression and Optimization
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="exercisesweek39.html">
Exercises week 39
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="week39.html">
Week 39: Optimization and Gradient Methods
</a>
</li>
</ul>
<p aria-level="2" class="caption" role="heading">
<span class="caption-text">
@@ -1673,8 +1683,8 @@ developed in the 1970s, namely EISPACK and LINPACK. We describe them shortly he
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[-1.24454968 1.12382443 0.67088558 1.12498355 1.0342028 -0.44563226
0.14599499 0.07378525 0.03479236 -1.2976637 ]
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[-0.60588173 1.59884169 -1.56922102 -1.32068736 -0.21631786 0.37600869
-0.14841322 -0.83655756 0.88809826 -0.85625134]
</pre></div>
</div>
</div>
@@ -1899,26 +1909,26 @@ lowercase letters for vectors and uppercase letters for matrices)</p>
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[[0.50306335 0.66487438 0.75677341 0.01349244 0.2813829 0.80056922
0.07974741 0.63046054 0.05098714 0.26479234]
[0.17861414 0.3388112 0.30005983 0.35520169 0.5399913 0.51709529
0.36339156 0.71582784 0.34568909 0.23164401]
[0.11922031 0.771128 0.20051449 0.07890044 0.96866031 0.34346829
0.5116375 0.52732966 0.80637385 0.69435454]
[0.94291287 0.29238145 0.84711297 0.22849742 0.56967917 0.1636508
0.15833751 0.84254917 0.05068486 0.54057582]
[0.17856374 0.71524686 0.66498292 0.00256622 0.72427854 0.50667812
0.0894015 0.22688898 0.54873252 0.31727523]
[0.73578772 0.81479491 0.45620975 0.2662452 0.47757553 0.64322974
0.54921401 0.70630967 0.51136852 0.59683811]
[0.37837864 0.71860732 0.35320952 0.67495943 0.16188604 0.41925189
0.28956161 0.06685171 0.75654448 0.28923 ]
[0.91099021 0.8387133 0.18277213 0.40418675 0.7249499 0.46415522
0.35018806 0.87148597 0.94141801 0.50911289]
[0.86066395 0.12235593 0.82418352 0.57881465 0.82559478 0.96826039
0.291056 0.41675053 0.06430789 0.96432396]
[0.91270333 0.64362404 0.18816387 0.81318307 0.47989224 0.20375464
0.33145794 0.92192012 0.33596404 0.18085537]]
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[[0.32641434 0.35731585 0.64796751 0.41146753 0.67561021 0.53312817
0.3910042 0.88157423 0.4576811 0.48004784]
[0.70469324 0.28496213 0.84862355 0.6988905 0.95890587 0.19849513
0.89058005 0.51546825 0.88289263 0.06926192]
[0.38198866 0.33000573 0.80740939 0.54935794 0.38934047 0.87740526
0.45053025 0.27231287 0.7070883 0.7989356 ]
[0.4198932 0.3727791 0.95400323 0.86459987 0.2666905 0.13564988
0.97498674 0.9450635 0.6383903 0.57803254]
[0.13896095 0.13663125 0.68826552 0.13729154 0.91672129 0.08266769
0.88639567 0.16407038 0.36353321 0.81007381]
[0.31849289 0.68735473 0.1767857 0.42873361 0.44454123 0.21333766
0.94285762 0.72710494 0.37153115 0.21070843]
[0.11930916 0.28021598 0.69566966 0.98770503 0.88653291 0.82161167
0.90114639 0.7127128 0.97486336 0.26152075]
[0.55386681 0.37919989 0.57468142 0.35980374 0.7150195 0.70499955
0.9647801 0.63142399 0.97512176 0.97570392]
[0.24613581 0.62573269 0.41487642 0.42095725 0.51447004 0.41869784
0.34483955 0.55582742 0.85711016 0.17739525]
[0.89533642 0.03382942 0.918785 0.79718864 0.64361375 0.4843772
0.33532886 0.13164176 0.63209435 0.39279291]]
</pre></div>
</div>
</div>
@@ -1973,13 +1983,13 @@ covariance matrix through the <strong>np.linalg.eig()</strong> function.</p>
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.1385510301651882
4.344176915013831
0.13134148011170077
[[ 0.87981676 2.52698542 2.65591748]
[ 2.52698542 8.29861395 7.76790092]
[ 2.65591748 7.76790092 13.4831139 ]]
[19.77845284 0.09028702 2.79280475]
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>-0.050315327923114654
3.7539148284817965
-0.09246293455466892
[[ 0.90894281 2.8691787 2.58589719]
[ 2.8691787 10.23481471 8.16535252]
[ 2.58589719 8.16535252 12.44536331]]
[20.33742926 0.08458591 3.16710567]
</pre></div>
</div>
</div>
@@ -2204,7 +2214,7 @@ Name: Aragorn, dtype: object
<div class="cell_output docutils container">
<div class="output traceback highlight-ipythontb notranslate"><div class="highlight"><pre><span></span><span class="gt">---------------------------------------------------------------------------</span>
<span class="ne">AttributeError</span><span class="g g-Whitespace"> </span>Traceback (most recent call last)
<span class="nn">/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_58840/1326197715.py</span> in <span class="ni">?</span><span class="nt">()</span>
<span class="nn">/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_95519/1326197715.py</span> in <span class="ni">?</span><span class="nt">()</span>
<span class="ne">----&gt; </span><span class="mi">6</span> <span class="n">new_hobbit</span> <span class="o">=</span> <span class="p">{</span><span class="s1">&#39;First Name&#39;</span><span class="p">:</span> <span class="p">[</span><span class="s2">&quot;Peregrin&quot;</span><span class="p">],</span>
<span class="g g-Whitespace"> </span><span class="mi">7</span> <span class="s1">&#39;Last Name&#39;</span><span class="p">:</span> <span class="p">[</span><span class="s2">&quot;Took&quot;</span><span class="p">],</span>
<span class="g g-Whitespace"> </span><span class="mi">8</span> <span class="s1">&#39;Place of birth&#39;</span><span class="p">:</span> <span class="p">[</span><span class="s2">&quot;Shire&quot;</span><span class="p">],</span>