Preface |
|
xi | |
|
|
1 | (6) |
|
What Is Linear Algebra and Why Learn It? |
|
|
1 | (1) |
|
|
2 | (1) |
|
|
2 | (2) |
|
|
3 | (1) |
|
|
3 | (1) |
|
|
3 | (1) |
|
Mathematical Proofs Versus Intuition from Coding |
|
|
4 | (1) |
|
Code, Printed in the Book and Downloadable Online |
|
|
5 | (1) |
|
|
5 | (1) |
|
How to Use This Book (for Teachers and Self Learners) |
|
|
6 | (1) |
|
|
7 | (26) |
|
Creating and Visualizing Vectors in NumPy |
|
|
7 | (4) |
|
|
10 | (1) |
|
|
11 | (6) |
|
|
11 | (1) |
|
Geometry of Vector Addition and Subtraction |
|
|
12 | (1) |
|
Vector-Scalar Multiplication |
|
|
13 | (1) |
|
|
14 | (1) |
|
|
15 | (1) |
|
Vector Broadcasting in Python |
|
|
16 | (1) |
|
Vector Magnitude and Unit Vectors |
|
|
17 | (1) |
|
|
18 | (4) |
|
The Dot Product Is Distributive |
|
|
20 | (1) |
|
Geometry of the Dot Product |
|
|
21 | (1) |
|
Other Vector Multiplications |
|
|
22 | (2) |
|
|
22 | (1) |
|
|
23 | (1) |
|
Cross and Triple Products |
|
|
24 | (1) |
|
Orthogonal Vector Decomposition |
|
|
24 | (4) |
|
|
28 | (1) |
|
|
29 | (4) |
|
|
33 | (16) |
|
|
33 | (1) |
|
Linear Weighted Combination |
|
|
34 | (1) |
|
|
35 | (3) |
|
The Math of Linear Independence |
|
|
37 | (1) |
|
Independence and the Zeros Vector |
|
|
38 | (1) |
|
|
38 | (3) |
|
|
41 | (5) |
|
|
44 | (2) |
|
|
46 | (1) |
|
|
46 | (3) |
|
|
49 | (12) |
|
Correlation and Cosine Similarity |
|
|
49 | (3) |
|
Time Series Filtering and Feature Detection |
|
|
52 | (1) |
|
|
53 | (4) |
|
|
57 | (4) |
|
|
57 | (1) |
|
Filtering and Feature Detection Exercises |
|
|
58 | (2) |
|
|
60 | (1) |
|
|
61 | (20) |
|
Creating and Visualizing Matrices in NumPy |
|
|
61 | (4) |
|
Visualizing, Indexing, and Slicing Matrices |
|
|
61 | (2) |
|
|
63 | (2) |
|
Matrix Math: Addition, Scalar Multiplication, Hadamard Multiplication |
|
|
65 | (2) |
|
|
65 | (1) |
|
|
66 | (1) |
|
Scalar and Hadamard Multiplications |
|
|
67 | (1) |
|
Standard Matrix Multiplication |
|
|
67 | (5) |
|
Rules for Matrix Multiplication Validity |
|
|
68 | (1) |
|
|
69 | (1) |
|
Matrix-Vector Multiplication |
|
|
70 | (2) |
|
Matrix Operations: Transpose |
|
|
72 | (1) |
|
Dot and Outer Product Notation |
|
|
73 | (1) |
|
Matrix Operations: LIVE EVIL (Order of Operations) |
|
|
73 | (1) |
|
|
74 | (1) |
|
Creating Symmetric Matrices from Nonsymmetric Matrices |
|
|
74 | (1) |
|
|
75 | (1) |
|
|
76 | (5) |
|
|
81 | (32) |
|
|
82 | (2) |
|
Matrix Trace and Frobenius Norm |
|
|
83 | (1) |
|
Matrix Spaces (Column, Row, Nulls) |
|
|
84 | (7) |
|
|
84 | (4) |
|
|
88 | (1) |
|
|
88 | (3) |
|
|
91 | (8) |
|
Ranks of Special Matrices |
|
|
94 | (2) |
|
Rank of Added and Multiplied Matrices |
|
|
96 | (1) |
|
|
97 | (1) |
|
|
98 | (1) |
|
|
99 | (2) |
|
|
99 | (1) |
|
Linear Independence of a Vector Set |
|
|
100 | (1) |
|
|
101 | (5) |
|
Computing the Determinant |
|
|
102 | (1) |
|
Determinant with Linear Dependencies |
|
|
103 | (1) |
|
The Characteristic Polynomial |
|
|
104 | (2) |
|
|
106 | (1) |
|
|
107 | (6) |
|
|
113 | (16) |
|
Multivariate Data Covariance Matrices |
|
|
113 | (3) |
|
Geometric Transformations via Matrix-Vector Multiplication |
|
|
116 | (4) |
|
|
120 | (4) |
|
|
124 | (1) |
|
|
124 | (5) |
|
Covariance and Correlation Matrices Exercises |
|
|
124 | (2) |
|
Geometric Transformations Exercises |
|
|
126 | (1) |
|
Image Feature Detection Exercises |
|
|
127 | (2) |
|
|
129 | (18) |
|
|
129 | (1) |
|
Types of Inverses and Conditions for Invertibility |
|
|
130 | (1) |
|
|
131 | (7) |
|
Inverse of a 2 × 2 Matrix |
|
|
131 | (2) |
|
Inverse of a Diagonal Matrix |
|
|
133 | (1) |
|
Inverting Any Square Full-Rank Matrix |
|
|
134 | (2) |
|
|
136 | (2) |
|
|
138 | (1) |
|
Moore-Penrose Pseudoinverse |
|
|
138 | (1) |
|
Numerical Stability of the Inverse |
|
|
139 | (2) |
|
Geometric Interpretation of the Inverse |
|
|
141 | (1) |
|
|
142 | (1) |
|
|
143 | (4) |
|
9 Orthogonal Matrices and QR Decomposition |
|
|
147 | (12) |
|
|
147 | (2) |
|
|
149 | (1) |
|
|
150 | (4) |
|
|
151 | (3) |
|
|
154 | (1) |
|
|
154 | (1) |
|
|
155 | (4) |
|
10 Row Reduction and LU Decomposition |
|
|
159 | (16) |
|
|
159 | (4) |
|
Converting Equations into Matrices |
|
|
160 | (1) |
|
Working with Matrix Equations |
|
|
161 | (2) |
|
|
163 | (6) |
|
|
165 | (1) |
|
|
166 | (1) |
|
Matrix Inverse via Gauss-Jordan Elimination |
|
|
167 | (2) |
|
|
169 | (2) |
|
Row Swaps via Permutation Matrices |
|
|
170 | (1) |
|
|
171 | (1) |
|
|
172 | (3) |
|
11 General Linear Models and Least Squares |
|
|
175 | (18) |
|
|
176 | (2) |
|
|
176 | (1) |
|
Setting Up a General Linear Model |
|
|
176 | (2) |
|
|
178 | (5) |
|
|
179 | (1) |
|
A Geometric Perspective on Least Squares |
|
|
180 | (1) |
|
Why Does Least Squares Work? |
|
|
181 | (2) |
|
|
183 | (4) |
|
|
187 | (1) |
|
|
188 | (1) |
|
|
188 | (5) |
|
12 Least Squares Applications |
|
|
193 | (20) |
|
Predicting Bike Rentals Based on Weather |
|
|
193 | (7) |
|
Regression Table Using statsmodels |
|
|
198 | (1) |
|
|
199 | (1) |
|
|
199 | (1) |
|
|
200 | (4) |
|
Grid Search to Find Model Parameters |
|
|
204 | (2) |
|
|
206 | (1) |
|
|
206 | (7) |
|
|
206 | (1) |
|
Multicollinearity Exercise |
|
|
207 | (1) |
|
|
208 | (2) |
|
Polynomial Regression Exercise |
|
|
210 | (1) |
|
|
210 | (3) |
|
|
213 | (28) |
|
Interpretations of Eigenvalues and Eigenvectors |
|
|
214 | (3) |
|
|
214 | (1) |
|
Statistics (Principal Components Analysis) |
|
|
215 | (1) |
|
|
216 | (1) |
|
Dimension Reduction (Data Compression) |
|
|
217 | (1) |
|
|
217 | (3) |
|
|
220 | (2) |
|
Sign and Scale Indeterminacy of Eigenvectors |
|
|
221 | (1) |
|
Diagonalizing a Square Matrix |
|
|
222 | (2) |
|
The Special Awesomeness of Symmetric Matrices |
|
|
224 | (3) |
|
|
224 | (2) |
|
|
226 | (1) |
|
Eigendecomposition of Singular Matrices |
|
|
227 | (1) |
|
Quadratic Form, Definiteness, and Eigenvalues |
|
|
228 | (4) |
|
The Quadratic Form of a Matrix |
|
|
228 | (2) |
|
|
230 | (1) |
|
ATA Is Positive (Semi)definite |
|
|
231 | (1) |
|
Generalized Eigendecomposition |
|
|
232 | (1) |
|
|
233 | (1) |
|
|
234 | (7) |
|
14 Singular Value Decomposition |
|
|
241 | (14) |
|
The Big Picture of the SVD |
|
|
241 | (2) |
|
Singular Values and Matrix Rank |
|
|
243 | (1) |
|
|
243 | (1) |
|
SVD and Rank-1 "Layers" of a Matrix |
|
|
244 | (2) |
|
|
246 | (3) |
|
|
247 | (1) |
|
Converting Singular Values to Variance, Explained |
|
|
247 | (1) |
|
|
248 | (1) |
|
SVD and the MP Pseudoinverse |
|
|
249 | (1) |
|
|
250 | (1) |
|
|
251 | (4) |
|
15 Eigendecomposition and SVD Applications |
|
|
255 | (24) |
|
PCA Using Eigendecomposition and SVD |
|
|
255 | (5) |
|
|
256 | (3) |
|
The Steps to Perform a PCA |
|
|
259 | (1) |
|
|
259 | (1) |
|
Linear Discriminant Analysis |
|
|
260 | (2) |
|
Low-Rank Approximations via SVD |
|
|
262 | (1) |
|
|
263 | (1) |
|
|
263 | (1) |
|
|
264 | (15) |
|
|
264 | (5) |
|
Linear Discriminant Analyses |
|
|
269 | (3) |
|
SVD for Low-Rank Approximations |
|
|
272 | (3) |
|
|
275 | (4) |
|
|
279 | (24) |
|
Why Python, and What Are the Alternatives? |
|
|
279 | (1) |
|
IDEs (Interactive Development Environments) |
|
|
280 | (1) |
|
Using Python Locally and Online |
|
|
280 | (2) |
|
Working with Code Files in Google Colab |
|
|
281 | (1) |
|
|
282 | (3) |
|
|
283 | (1) |
|
|
284 | (1) |
|
|
285 | (5) |
|
|
286 | (1) |
|
Writing Your Own Functions |
|
|
287 | (1) |
|
|
288 | (1) |
|
|
289 | (1) |
|
Indexing and Slicing in NumPy |
|
|
289 | (1) |
|
|
290 | (3) |
|
Translating Formulas to Code |
|
|
293 | (3) |
|
Print Formatting and F-Strings |
|
|
296 | (1) |
|
|
297 | (4) |
|
|
297 | (1) |
|
|
297 | (2) |
|
|
299 | (1) |
|
Nested Control Statements |
|
|
300 | (1) |
|
Measuring Computation Time |
|
|
301 | (1) |
|
Getting Help and Learning More |
|
|
301 | (1) |
|
What to Do When Things Go Awry |
|
|
301 | (1) |
|
|
302 | (1) |
Index |
|
303 | |