Book description

If you want to work in any computational or technical field, you need to understand linear algebra. As the study of matrices and operations acting upon them, linear algebra is the mathematical basis of nearly all algorithms and analyses implemented in computers. But the way it's presented in decades-old textbooks is much different from how professionals use linear algebra today to solve real-world modern applications.

This practical guide from Mike X Cohen teaches the core concepts of linear algebra as implemented in Python, including how they're used in data science, machine learning, deep learning, computational simulations, and biomedical data processing applications. Armed with knowledge from this book, you'll be able to understand, implement, and adapt myriad modern analysis methods and algorithms.

Ideal for practitioners and students using computer technology and algorithms, this book introduces you to:

• The interpretations and applications of vectors and matrices
• Matrix arithmetic (various multiplications and transformations)
• Independence, rank, and inverses
• Important decompositions used in applied linear algebra (including LU and QR)
• Eigendecomposition and singular value decomposition
• Applications including least-squares model fitting and principal components analysis

Publisher resources

View/Submit Errata

1. Preface
2. 1. Introduction
1. What Is Linear Algebra and Why Learn It?
3. Prerequisites
4. Mathematical Proofs Versus Intuition from Coding
6. Code Exercises
7. How to Use This Book (for Teachers and Self Learners)
3. 2. Vectors, Part 1
1. Creating and Visualizing Vectors in NumPy
2. Operations on Vectors
3. Vector Magnitude and Unit Vectors
4. The Vector Dot Product
5. Other Vector Multiplications
6. Orthogonal Vector Decomposition
7. Summary
8. Code Exercises
4. 3. Vectors, Part 2
1. Vector Sets
2. Linear Weighted Combination
3. Linear Independence
4. Subspace and Span
5. Basis
6. Summary
7. Code Exercises
5. 4. Vector Applications
1. Correlation and Cosine Similarity
2. Time Series Filtering and Feature Detection
3. k-Means Clustering
4. Code Exercises
6. 5. Matrices, Part 1
1. Creating and Visualizing Matrices in NumPy
3. Standard Matrix Multiplication
4. Matrix Operations: Transpose
5. Matrix Operations: LIVE EVIL (Order of Operations)
6. Symmetric Matrices
7. Summary
8. Code Exercises
7. 6. Matrices, Part 2
1. Matrix Norms
2. Matrix Spaces (Column, Row, Nulls)
3. Rank
4. Rank Applications
5. Determinant
6. Summary
7. Code Exercises
8. 7. Matrix Applications
1. Multivariate Data Covariance Matrices
2. Geometric Transformations via Matrix-Vector Multiplication
3. Image Feature Detection
4. Summary
5. Code Exercises
9. 8. Matrix Inverse
1. The Matrix Inverse
2. Types of Inverses and Conditions for Invertibility
3. Computing the Inverse
4. The Inverse Is Unique
5. Moore-Penrose Pseudoinverse
6. Numerical Stability of the Inverse
7. Geometric Interpretation of the Inverse
8. Summary
9. Code Exercises
10. 9. Orthogonal Matrices and QR Decomposition
1. Orthogonal Matrices
2. Gram-Schmidt
3. QR Decomposition
4. Summary
5. Code Exercises
11. 10. Row Reduction and LU Decomposition
1. Systems of Equations
2. Row Reduction
3. LU Decomposition
4. Summary
5. Code Exercises
12. 11. General Linear Models and Least Squares
1. General Linear Models
2. Solving GLMs
3. GLM in a Simple Example
4. Least Squares via QR
5. Summary
6. Code Exercises
13. 12. Least Squares Applications
1. Predicting Bike Rentals Based on Weather
2. Polynomial Regression
3. Grid Search to Find Model Parameters
4. Summary
5. Code Exercises
14. 13. Eigendecomposition
1. Interpretations of Eigenvalues and Eigenvectors
2. Finding Eigenvalues
3. Finding Eigenvectors
4. Diagonalizing a Square Matrix
5. The Special Awesomeness of Symmetric Matrices
6. Eigendecomposition of Singular Matrices
7. Quadratic Form, Definiteness, and Eigenvalues
8. Generalized Eigendecomposition
9. Summary
10. Code Exercises
15. 14. Singular Value Decomposition
1. The Big Picture of the SVD
2. SVD in Python
3. SVD and Rank-1 “Layers” of a Matrix
4. SVD from EIG
5. SVD and the MP Pseudoinverse
6. Summary
7. Code Exercises
16. 15. Eigendecomposition and SVD Applications
1. PCA Using Eigendecomposition and SVD
2. Linear Discriminant Analysis
3. Low-Rank Approximations via SVD
4. Summary
5. Exercises
17. 16. Python Tutorial
1. Why Python, and What Are the Alternatives?
2. IDEs (Interactive Development Environments)
3. Using Python Locally and Online
4. Variables
5. Functions
6. Visualization
7. Translating Formulas to Code
8. Print Formatting and F-Strings
9. Control Flow
10. Measuring Computation Time
11. Getting Help and Learning More
12. Summary
18. Index