update
This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>2. Linear Algebra, Handling of Arrays and more Python Features — Applied Data Analysis and Machine Learning</title>
|
||||
|
||||
<link href="_static/css/theme.css" rel="stylesheet" />
|
||||
<link href="_static/css/index.c5995385ac14fb8791e8eb36b4908be2.css" rel="stylesheet" />
|
||||
<link href="_static/css/theme.css" rel="stylesheet">
|
||||
<link href="_static/css/index.ff1ffe594081f20da1ef19478df9384b.css" rel="stylesheet">
|
||||
|
||||
|
||||
<link rel="stylesheet"
|
||||
@@ -31,31 +31,37 @@
|
||||
<link rel="stylesheet" type="text/css" href="_static/panels-main.c949a650a448cc0ae9fd3441c0e17fb0.css" />
|
||||
<link rel="stylesheet" type="text/css" href="_static/panels-variables.06eb56fa6e07937060861dad626602ad.css" />
|
||||
|
||||
<link rel="preload" as="script" href="_static/js/index.1c5a1a01449ed65a7b51.js">
|
||||
<link rel="preload" as="script" href="_static/js/index.be7d3bbb2ef33a8344ce.js">
|
||||
|
||||
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
|
||||
<script src="_static/jquery.js"></script>
|
||||
<script src="_static/underscore.js"></script>
|
||||
<script src="_static/doctools.js"></script>
|
||||
<script src="_static/togglebutton.js"></script>
|
||||
<script src="_static/clipboard.min.js"></script>
|
||||
<script src="_static/copybutton.js"></script>
|
||||
<script>let toggleHintShow = 'Click to show';</script>
|
||||
<script>let toggleHintHide = 'Click to hide';</script>
|
||||
<script>let toggleOpenOnPrint = 'true';</script>
|
||||
<script src="_static/togglebutton.js"></script>
|
||||
<script>var togglebuttonSelector = '.toggle, .admonition.dropdown, .tag_hide_input div.cell_input, .tag_hide-input div.cell_input, .tag_hide_output div.cell_output, .tag_hide-output div.cell_output, .tag_hide_cell.cell, .tag_hide-cell.cell';</script>
|
||||
<script src="_static/sphinx-book-theme.12a9622fbb08dcb3a2a40b2c02b83a57.js"></script>
|
||||
<script src="_static/sphinx-book-theme.d59cb220de22ca1c485ebbdc042f0030.js"></script>
|
||||
<script>const THEBE_JS_URL = "https://unpkg.com/thebe@0.8.2/lib/index.js"
|
||||
const thebe_selector = ".thebe,.cell"
|
||||
const thebe_selector_input = "pre"
|
||||
const thebe_selector_output = ".output, .cell_output"
|
||||
</script>
|
||||
<script async="async" src="_static/sphinx-thebe.js"></script>
|
||||
<script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
|
||||
<script>window.MathJax = {"options": {"processHtmlClass": "tex2jax_process|mathjax_process|math|output_area"}}</script>
|
||||
<script defer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
<link rel="next" title="3. Linear Regression" href="chapter1.html" />
|
||||
<link rel="prev" title="1. Elements of Probability Theory and Statistical Data Analysis" href="statistics.html" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="docsearch:language" content="en" />
|
||||
<meta name="docsearch:language" content="None">
|
||||
|
||||
|
||||
<!-- Google Analytics -->
|
||||
|
||||
</head>
|
||||
<body data-spy="scroll" data-target="#bd-toc-nav" data-offset="80">
|
||||
@@ -94,7 +100,7 @@ const thebe_selector_output = ".output, .cell_output"
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="caption" role="heading">
|
||||
<p aria-level="2" class="caption" role="heading">
|
||||
<span class="caption-text">
|
||||
About the course
|
||||
</span>
|
||||
@@ -116,7 +122,7 @@ const thebe_selector_output = ".output, .cell_output"
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="caption" role="heading">
|
||||
<p aria-level="2" class="caption" role="heading">
|
||||
<span class="caption-text">
|
||||
Review of Statistics with Resampling Techniques and Linear Algebra
|
||||
</span>
|
||||
@@ -133,7 +139,7 @@ const thebe_selector_output = ".output, .cell_output"
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="caption" role="heading">
|
||||
<p aria-level="2" class="caption" role="heading">
|
||||
<span class="caption-text">
|
||||
From Regression to Support Vector Machines
|
||||
</span>
|
||||
@@ -170,7 +176,7 @@ const thebe_selector_output = ".output, .cell_output"
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="caption" role="heading">
|
||||
<p aria-level="2" class="caption" role="heading">
|
||||
<span class="caption-text">
|
||||
Decision Trees, Ensemble Methods and Boosting
|
||||
</span>
|
||||
@@ -187,7 +193,7 @@ const thebe_selector_output = ".output, .cell_output"
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="caption" role="heading">
|
||||
<p aria-level="2" class="caption" role="heading">
|
||||
<span class="caption-text">
|
||||
Dimensionality Reduction
|
||||
</span>
|
||||
@@ -204,7 +210,7 @@ const thebe_selector_output = ".output, .cell_output"
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="caption" role="heading">
|
||||
<p aria-level="2" class="caption" role="heading">
|
||||
<span class="caption-text">
|
||||
Deep Learning Methods
|
||||
</span>
|
||||
@@ -281,7 +287,7 @@ const thebe_selector_output = ".output, .cell_output"
|
||||
data-placement="left">.ipynb</button></a>
|
||||
<!-- Download PDF via print -->
|
||||
<button type="button" id="download-print" class="btn btn-secondary topbarbtn" title="Print to PDF"
|
||||
onClick="window.print()" data-toggle="tooltip" data-placement="left">.pdf</button>
|
||||
onclick="printPdf(this)" data-toggle="tooltip" data-placement="left">.pdf</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -299,7 +305,7 @@ const thebe_selector_output = ".output, .cell_output"
|
||||
</div>
|
||||
|
||||
<!-- Table of contents -->
|
||||
<div class="d-none d-md-block col-md-2 bd-toc show">
|
||||
<div class="d-none d-md-block col-md-2 bd-toc show noprint">
|
||||
|
||||
<div class="tocsection onthispage pt-5 pb-3">
|
||||
<i class="fas fa-list"></i> Contents
|
||||
@@ -358,7 +364,69 @@ const thebe_selector_output = ".output, .cell_output"
|
||||
</div>
|
||||
<div id="main-content" class="row">
|
||||
<div class="col-12 col-md-9 pl-md-3 pr-md-0">
|
||||
|
||||
<!-- Table of contents that is only displayed when printing the page -->
|
||||
<div id="jb-print-docs-body" class="onlyprint">
|
||||
<h1>Linear Algebra, Handling of Arrays and more Python Features</h1>
|
||||
<!-- Table of contents -->
|
||||
<div id="print-main-content">
|
||||
<div id="jb-print-toc">
|
||||
|
||||
<div>
|
||||
<h2> Contents </h2>
|
||||
</div>
|
||||
<nav aria-label="Page">
|
||||
<ul class="visible nav section-nav flex-column">
|
||||
<li class="toc-h2 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#introduction">
|
||||
2.1. Introduction
|
||||
</a>
|
||||
</li>
|
||||
<li class="toc-h2 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#important-matrix-and-vector-handling-packages">
|
||||
2.2. Important Matrix and vector handling packages
|
||||
</a>
|
||||
</li>
|
||||
<li class="toc-h2 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#basic-matrix-features">
|
||||
2.3. Basic Matrix Features
|
||||
</a>
|
||||
<ul class="nav section-nav flex-column">
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#some-famous-matrices">
|
||||
2.3.1. Some famous Matrices
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toc-h2 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#numpy-and-arrays">
|
||||
2.4. Numpy and arrays
|
||||
</a>
|
||||
</li>
|
||||
<li class="toc-h2 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#other-matrix-and-vector-operations">
|
||||
2.5. Other Matrix and Vector Operations
|
||||
</a>
|
||||
</li>
|
||||
<li class="toc-h2 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#gaussian-elimination">
|
||||
2.6. Gaussian Elimination
|
||||
</a>
|
||||
<ul class="nav section-nav flex-column">
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#lu-decomposition-the-inverse-of-a-matrix">
|
||||
2.6.1. LU Decomposition, the inverse of a matrix
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
|
||||
<!-- HTML file automatically generated from DocOnce source (https://github.com/doconce/doconce/)
|
||||
@@ -476,8 +544,8 @@ matrices and vectors.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[ 0.80738685 -0.37307168 -0.28967287 -0.1023111 -0.42394972 -0.04775904
|
||||
-0.83698677 0.60538875 -0.61463451 -1.12069773]
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[-1.25902112 -0.51174395 -0.29276615 1.6489862 -1.69115646 1.62620724
|
||||
0.65444431 -1.35346808 -0.20316225 1.12630042]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -698,26 +766,26 @@ as (recall that we user lowercase letters for vectors and uppercase letters for
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[[0.40214433 0.46508305 0.10620135 0.26186844 0.28067036 0.092066
|
||||
0.30552077 0.51265232 0.57673618 0.76674796]
|
||||
[0.92626212 0.11046771 0.14484695 0.03981057 0.09856879 0.81187794
|
||||
0.43135183 0.43552433 0.03794112 0.96606158]
|
||||
[0.76066069 0.84232163 0.38336316 0.53312754 0.35147135 0.05434571
|
||||
0.21472683 0.96527903 0.18912963 0.56302854]
|
||||
[0.21786964 0.08428156 0.90895045 0.70205195 0.70980493 0.90884627
|
||||
0.09085624 0.35892474 0.68246089 0.51561271]
|
||||
[0.15891336 0.25259666 0.75106135 0.07878641 0.96032148 0.31605061
|
||||
0.60236938 0.04368707 0.34568872 0.24276315]
|
||||
[0.98794823 0.88871662 0.16740002 0.21997099 0.18156717 0.11402309
|
||||
0.85758696 0.51389553 0.45290829 0.89274639]
|
||||
[0.21519063 0.20174121 0.32320052 0.34585355 0.93579127 0.07735703
|
||||
0.63860687 0.10302062 0.28047021 0.48212873]
|
||||
[0.50727059 0.89873772 0.28875373 0.65628853 0.87940752 0.68279358
|
||||
0.51004249 0.46567887 0.37415316 0.91383439]
|
||||
[0.90940378 0.25792767 0.17930649 0.24512498 0.10505137 0.0714956
|
||||
0.69493539 0.35203688 0.1583767 0.80747253]
|
||||
[0.98266587 0.39456996 0.48574149 0.461175 0.30384239 0.53423784
|
||||
0.79009329 0.38868469 0.8991514 0.39560937]]
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[[0.26185107 0.82454365 0.97434186 0.56556315 0.58187347 0.72509099
|
||||
0.19158446 0.3263505 0.0536097 0.90066122]
|
||||
[0.34678929 0.66981186 0.44152248 0.20299677 0.1614891 0.68485505
|
||||
0.43333886 0.45741697 0.31311243 0.88001352]
|
||||
[0.29661191 0.05268304 0.98153145 0.9007164 0.69481746 0.35319678
|
||||
0.88063413 0.06319374 0.06695337 0.75350216]
|
||||
[0.15089627 0.58671946 0.13734823 0.72394787 0.38019139 0.422275
|
||||
0.35821426 0.49282737 0.19144544 0.84653115]
|
||||
[0.38637915 0.8049181 0.49672291 0.98699753 0.8192798 0.05850532
|
||||
0.00152188 0.13131825 0.31229747 0.40183706]
|
||||
[0.8705211 0.1472032 0.22567203 0.55202922 0.62683307 0.41566661
|
||||
0.23659936 0.85086629 0.85120833 0.79135075]
|
||||
[0.31377492 0.38629844 0.33956555 0.64064128 0.42028578 0.58474054
|
||||
0.71760245 0.51732028 0.31211671 0.35894575]
|
||||
[0.78286771 0.72594302 0.22821344 0.23962594 0.48739546 0.59190877
|
||||
0.8557822 0.44830642 0.90595152 0.9626883 ]
|
||||
[0.34498451 0.90694878 0.15442554 0.43560678 0.89045167 0.21654926
|
||||
0.00355118 0.18695705 0.61123608 0.7386068 ]
|
||||
[0.30813073 0.26549135 0.96812218 0.94321297 0.81592628 0.60980325
|
||||
0.4284066 0.8792323 0.92968793 0.82073684]]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -777,13 +845,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.048653428302840175
|
||||
4.098802859381565
|
||||
-0.13229545716505003
|
||||
[[0.89550839 2.74368436 2.15717291]
|
||||
[2.74368436 9.71131626 6.39311435]
|
||||
[2.15717291 6.39311435 7.55505907]]
|
||||
[15.92603747 0.07903849 2.15680777]
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>-0.2246674023625205
|
||||
3.345687771875474
|
||||
-0.6084611325305795
|
||||
[[ 1.17709473 3.57810065 3.67258699]
|
||||
[ 3.57810065 11.8548082 11.12152272]
|
||||
[ 3.67258699 11.12152272 15.62249103]]
|
||||
[26.06969872 0.07319349 2.51150176]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1333,54 +1401,42 @@ These details will be presented in our linear regression chapter.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class='prev-next-bottom'>
|
||||
|
||||
<div id="prev">
|
||||
<a class="left-prev" href="statistics.html" title="previous page">
|
||||
<i class="prevnext-label fas fa-angle-left"></i>
|
||||
<div class="prevnext-info">
|
||||
<p class="prevnext-label">previous</p>
|
||||
<p class="prevnext-title"><span class="section-number">1. </span>Elements of Probability Theory and Statistical Data Analysis</p>
|
||||
</div>
|
||||
</a>
|
||||
<!-- Previous / next buttons -->
|
||||
<div class='prev-next-area'>
|
||||
<a class='left-prev' id="prev-link" href="statistics.html" title="previous page">
|
||||
<i class="fas fa-angle-left"></i>
|
||||
<div class="prev-next-info">
|
||||
<p class="prev-next-subtitle">previous</p>
|
||||
<p class="prev-next-title"><span class="section-number">1. </span>Elements of Probability Theory and Statistical Data Analysis</p>
|
||||
</div>
|
||||
</a>
|
||||
<a class='right-next' id="next-link" href="chapter1.html" title="next page">
|
||||
<div class="prev-next-info">
|
||||
<p class="prev-next-subtitle">next</p>
|
||||
<p class="prev-next-title"><span class="section-number">3. </span>Linear Regression</p>
|
||||
</div>
|
||||
<div id="next">
|
||||
<a class="right-next" href="chapter1.html" title="next page">
|
||||
<div class="prevnext-info">
|
||||
<p class="prevnext-label">next</p>
|
||||
<p class="prevnext-title"><span class="section-number">3. </span>Linear Regression</p>
|
||||
</div>
|
||||
<i class="prevnext-label fas fa-angle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<i class="fas fa-angle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<footer class="footer">
|
||||
<div class="container">
|
||||
<p>
|
||||
|
||||
By Morten Hjorth-Jensen<br/>
|
||||
|
||||
© Copyright 2021.<br/>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
<p>
|
||||
|
||||
By Morten Hjorth-Jensen<br/>
|
||||
|
||||
© Copyright 2021.<br/>
|
||||
</p>
|
||||
</footer>
|
||||
</main>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="_static/js/index.1c5a1a01449ed65a7b51.js"></script>
|
||||
<script src="_static/js/index.be7d3bbb2ef33a8344ce.js"></script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user