tensorflow problems with chapter 12
This commit is contained in:
@@ -532,10 +532,10 @@ 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.1014841451296029
|
||||
3.744674093727182
|
||||
[[ 1.04621283 3.2509618 ]
|
||||
[ 3.2509618 11.28244928]]
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>-0.13740265686642364
|
||||
3.647867896223553
|
||||
[[0.88732076 2.58645106]
|
||||
[2.58645106 8.40379027]]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -575,10 +575,10 @@ a more brute force way. Here we scale the mean values for each column of the des
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.08899392007617646
|
||||
1.960919045835183
|
||||
[[1. 0.64606848]
|
||||
[0.64606848 1. ]]
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.09282061240353208
|
||||
2.0679953259809554
|
||||
[[1. 0.65276752]
|
||||
[0.65276752 1. ]]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -607,30 +607,30 @@ this matrix we easily see that it is a positive definite matrix.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[[-0.26338419 -0.43128913]
|
||||
[-0.40052348 -0.40977892]
|
||||
[-1.21495309 -3.03292103]
|
||||
[-0.68288031 -2.86961626]
|
||||
[ 1.847187 7.221629 ]
|
||||
[-0.01324363 0.06365882]
|
||||
[-0.08321393 -1.11171059]
|
||||
[ 0.6497097 1.58382502]
|
||||
[-0.3196681 -1.46807752]
|
||||
[ 0.48097003 0.45428062]]
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[[ 0.27416797 2.69235507]
|
||||
[-0.30895532 -1.36796587]
|
||||
[ 1.03285324 2.17106672]
|
||||
[-0.35304998 -2.85655181]
|
||||
[-0.79084976 -1.67951873]
|
||||
[ 0.19247017 0.868215 ]
|
||||
[-0.45745139 -2.25170803]
|
||||
[-0.63165748 -1.85258411]
|
||||
[-0.19636844 0.14649905]
|
||||
[ 1.238841 4.13019269]]
|
||||
0 1
|
||||
0 -0.263384 -0.431289
|
||||
1 -0.400523 -0.409779
|
||||
2 -1.214953 -3.032921
|
||||
3 -0.682880 -2.869616
|
||||
4 1.847187 7.221629
|
||||
5 -0.013244 0.063659
|
||||
6 -0.083214 -1.111711
|
||||
7 0.649710 1.583825
|
||||
8 -0.319668 -1.468078
|
||||
9 0.480970 0.454281
|
||||
0 0.274168 2.692355
|
||||
1 -0.308955 -1.367966
|
||||
2 1.032853 2.171067
|
||||
3 -0.353050 -2.856552
|
||||
4 -0.790850 -1.679519
|
||||
5 0.192470 0.868215
|
||||
6 -0.457451 -2.251708
|
||||
7 -0.631657 -1.852584
|
||||
8 -0.196368 0.146499
|
||||
9 1.238841 4.130193
|
||||
0 1
|
||||
0 1.000000 0.959043
|
||||
1 0.959043 1.000000
|
||||
0 1.000000 0.899606
|
||||
1 0.899606 1.000000
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -687,37 +687,37 @@ this matrix we easily see that it is a positive definite matrix.</p>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> 0 1 2 3 4 5 6 7 \
|
||||
0 0.0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
|
||||
1 0.0 0.077527 0.078731 0.077076 0.078129 0.079210 0.068328 0.069362
|
||||
2 0.0 0.078731 0.081031 0.079460 0.081106 0.082747 0.071284 0.072687
|
||||
3 0.0 0.077076 0.079460 0.081529 0.083368 0.085189 0.075205 0.076784
|
||||
4 0.0 0.078129 0.081106 0.083368 0.085569 0.087738 0.077404 0.079228
|
||||
5 0.0 0.079210 0.082747 0.085189 0.087738 0.090239 0.079562 0.081623
|
||||
6 0.0 0.068328 0.071284 0.075205 0.077404 0.079562 0.071309 0.073110
|
||||
7 0.0 0.069362 0.072687 0.076784 0.079228 0.081623 0.073110 0.075086
|
||||
8 0.0 0.070455 0.074134 0.078402 0.081085 0.083711 0.074934 0.077084
|
||||
9 0.0 0.071609 0.075631 0.080066 0.082982 0.085835 0.076789 0.079111
|
||||
10 0.0 0.059604 0.062733 0.067433 0.069731 0.071979 0.065235 0.067080
|
||||
11 0.0 0.060603 0.063986 0.068834 0.071311 0.073734 0.066778 0.068758
|
||||
12 0.0 0.061660 0.065292 0.070286 0.072940 0.075537 0.068363 0.070479
|
||||
13 0.0 0.062777 0.066653 0.071794 0.074624 0.077395 0.069997 0.072248
|
||||
14 0.0 0.063954 0.068071 0.073361 0.076367 0.079312 0.071682 0.074070
|
||||
1 0.0 0.090368 0.089828 0.084745 0.089694 0.094385 0.072722 0.077607
|
||||
2 0.0 0.089828 0.091016 0.082203 0.087699 0.093293 0.069684 0.074647
|
||||
3 0.0 0.084745 0.082203 0.084433 0.088351 0.091653 0.075222 0.079774
|
||||
4 0.0 0.089694 0.087699 0.088351 0.092763 0.096661 0.078226 0.083104
|
||||
5 0.0 0.094385 0.093293 0.091653 0.096661 0.101332 0.080548 0.085760
|
||||
6 0.0 0.072722 0.069684 0.075222 0.078226 0.080548 0.068780 0.072668
|
||||
7 0.0 0.077607 0.074647 0.079774 0.083104 0.085760 0.072668 0.076854
|
||||
8 0.0 0.082726 0.079963 0.084408 0.088121 0.091191 0.076564 0.081069
|
||||
9 0.0 0.088020 0.085632 0.089011 0.093180 0.096774 0.080344 0.085192
|
||||
10 0.0 0.062054 0.059107 0.065855 0.068244 0.069993 0.061366 0.064683
|
||||
11 0.0 0.066283 0.063260 0.070074 0.072690 0.074644 0.065135 0.068701
|
||||
12 0.0 0.070793 0.067729 0.074516 0.077390 0.079587 0.069075 0.072910
|
||||
13 0.0 0.075587 0.072539 0.079162 0.082333 0.084822 0.073160 0.077286
|
||||
14 0.0 0.080656 0.077711 0.083974 0.087490 0.090338 0.077343 0.081784
|
||||
|
||||
8 9 10 11 12 13 14
|
||||
0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
|
||||
1 0.070455 0.071609 0.059604 0.060603 0.061660 0.062777 0.063954
|
||||
2 0.074134 0.075631 0.062733 0.063986 0.065292 0.066653 0.068071
|
||||
3 0.078402 0.080066 0.067433 0.068834 0.070286 0.071794 0.073361
|
||||
4 0.081085 0.082982 0.069731 0.071311 0.072940 0.074624 0.076367
|
||||
5 0.083711 0.085835 0.071979 0.073734 0.075537 0.077395 0.079312
|
||||
6 0.074934 0.076789 0.065235 0.066778 0.068363 0.069997 0.071682
|
||||
7 0.077084 0.079111 0.067080 0.068758 0.070479 0.072248 0.074070
|
||||
8 0.079253 0.081450 0.068941 0.070753 0.072608 0.074513 0.076473
|
||||
9 0.081450 0.083817 0.070824 0.072770 0.074761 0.076803 0.078901
|
||||
10 0.068941 0.070824 0.060591 0.062149 0.063743 0.065378 0.067060
|
||||
11 0.070753 0.072770 0.062149 0.063814 0.065517 0.067262 0.069055
|
||||
12 0.072608 0.074761 0.063743 0.065517 0.067329 0.069185 0.071092
|
||||
13 0.074513 0.076803 0.065378 0.067262 0.069185 0.071155 0.073178
|
||||
14 0.076473 0.078901 0.067060 0.069055 0.071092 0.073178 0.075318
|
||||
1 0.082726 0.088020 0.062054 0.066283 0.070793 0.075587 0.080656
|
||||
2 0.079963 0.085632 0.059107 0.063260 0.067729 0.072539 0.077711
|
||||
3 0.084408 0.089011 0.065855 0.070074 0.074516 0.079162 0.083974
|
||||
4 0.088121 0.093180 0.068244 0.072690 0.077390 0.082333 0.087490
|
||||
5 0.091191 0.096774 0.069993 0.074644 0.079587 0.084822 0.090338
|
||||
6 0.076564 0.080344 0.061366 0.065135 0.069075 0.073160 0.077343
|
||||
7 0.081069 0.085192 0.064683 0.068701 0.072910 0.077286 0.081784
|
||||
8 0.085636 0.090149 0.067977 0.072252 0.076743 0.081428 0.086266
|
||||
9 0.090149 0.095107 0.071137 0.075674 0.080455 0.085465 0.090671
|
||||
10 0.067977 0.071137 0.055542 0.058856 0.062305 0.065864 0.069488
|
||||
11 0.072252 0.075674 0.058856 0.062396 0.066086 0.069899 0.073789
|
||||
12 0.076743 0.080455 0.062305 0.066086 0.070032 0.074118 0.078298
|
||||
13 0.081428 0.085465 0.065864 0.069899 0.074118 0.078497 0.082989
|
||||
14 0.086266 0.090671 0.069488 0.073789 0.078298 0.082989 0.087822
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -906,10 +906,10 @@ We can write our own code or simply use either the functionaly of <strong>numpy<
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> 0 1
|
||||
0 3.982025 2.012742
|
||||
1 2.012742 2.042269
|
||||
[[3.98202489 2.01274179]
|
||||
[2.01274179 2.04226949]]
|
||||
0 3.900266 1.942180
|
||||
1 1.942180 1.965724
|
||||
[[3.90026646 1.9421795 ]
|
||||
[1.9421795 1.96572363]]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -936,8 +936,8 @@ Our own code here is not very elegant and asks for obvious improvements. It is t
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Centered covariance using own code
|
||||
[[3.98202489 2.01274179]
|
||||
[2.01274179 2.04226949]]
|
||||
[[3.90026646 1.9421795 ]
|
||||
[1.9421795 1.96572363]]
|
||||
</pre></div>
|
||||
</div>
|
||||
<img alt="_images/chapter8_65_1.png" src="_images/chapter8_65_1.png" />
|
||||
@@ -997,16 +997,16 @@ questions.</p>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Eigenvalues of Covariance matrix
|
||||
5.246379112732898
|
||||
0.7779152676639822
|
||||
5.102712819944882
|
||||
0.763277270613554
|
||||
First eigenvector
|
||||
[0.84678774 0.53193095]
|
||||
[0.85023678 0.52640043]
|
||||
Second eigenvector
|
||||
[-0.53193095 0.84678774]
|
||||
[-0.52640043 0.85023678]
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Eigenvector of largest eigenvalue
|
||||
[0.84678774 0.53193095]
|
||||
[-0.85023678 -0.52640043]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user