
Learn the fundamentals of linear algebra for data science and machine learning with Python, covering vectors, matrices, determinants, norms, eigenvalues, and singular value decomposition with NumPy demos.
Explore how linear algebra powers data science and machine learning by using vectors, matrices, and tensors to extract useful information, essential for understanding ML and DL.
Discover how linear algebra underpins data science with vectors, matrices, and tensors, using linear equations to represent data in tables where rows are samples and columns are attributes.
Discover why linear algebra underpins data preprocessing and transformation in higher dimensions. It forms the basis of machine learning, supporting regression, optimization, classification, dimensionality reduction, neural networks, and deep learning.
Download and install python from python.org for your OS, add python to environment variables, and verify the setup by running simple code in idle.
Discover how to install the Anaconda distribution, launch Jupyter Notebook, and run a simple Python program in a project folder across Windows, Mac OS, and Linux.
Explore scalars and vectors as objects in linear algebra and data science. Define scalars as numbers with magnitude, and describe vectors as ordered components stored as column or row forms.
Visualize vectors in three dimensional space using R3 coordinates. Demonstrate with u = (3, -7, 5) and v = (6, 4, 2), and show column vector representation in data science.
Explore vectors in n dimensional space and represent data with rn column vectors. See how eight weather attributes form an eight-dimensional vector and relate to r2 and r3.
Learn to create vectors in Python with numpy, importing numpy as NP, using NP.array, and printing vectors like P, L, and Lisbon; explore vector dimensions and component counts.
Create vectors of consecutive numbers with numpy using arange and range, specifying start, stop, and step to generate ascending or descending sequences, including even-number patterns.
Access and modify vector elements in python using zero-based indexing with numpy. Use L[0] and L[3] to access, L[2] = 35 to modify, and note index errors for out-of-range access.
Introduce zero vectors as vectors with all zero components in R2, R3, and Rn, representing the origin, and ones vectors as vectors with all components equal to one.
Learn how to create zero and ones vectors in numpy using np.array and np.zeros or np.ones, including specifying component counts and displaying results.
Add two column vectors by summing corresponding components to obtain a new vector. Ensure both vectors have the same dimension, with examples in R2, R3, and Rn.
Learn vector addition in Python using numpy by adding corresponding components of two vectors. See how element-wise summation yields total income and total expenses from example vectors.
Multiply each vector component by a scalar to perform scalar multiplication. See how it scales a vector's length and direction, for example [2,3] becomes [4,6].
Explore scalar multiplication of vectors by multiplying each component by a scalar using numpy. See income and expenses vectors and a few examples that illustrate the elementwise results.
Explore the linear algebra properties of vectors in n-dimensional space, including commutativity and associativity of addition, additive identity, and distributive and associative rules for scalar multiplication.
Learn how linear combinations form from adding and scaling vectors, illustrated by 2u + 3v, and how any vectors can be combined with coefficients c1 through cn.
Explore linear combinations of vectors through addition and scalar multiplication using numpy. Construct vectors u and v, compute w = 2u + 3v, and display the result [24, -2].
Explore column and row vectors and the transpose operation, denoted by t, and see that the transpose of a transposed vector returns the original.
Import NumPy and create a one-row vector with mat to form a row matrix. Transpose the vector using the t attribute to obtain a column vector and display the result.
Explore the dot product (inner product) of two vectors, computed as a transpose times the vector, yielding a scalar that signals similarity and direction in r2 and r3.
Learn to compute the dot product of two vectors using numpy's dot function, ensure equal dimensions, and interpret the result as a scalar through practical vector examples.
Compute the outer product as a column vector times the transpose of a row vector, yielding an n by n matrix; unlike the inner product, it is not a scalar.
Explore how to compute the outer product of two vectors using numpy's outer function, producing a matrix from vector components and noting that the dot product requires equal vector dimensions.
Learn how data in data science is stored in matrices, a tabular two-dimensional array of numbers, with rows as observations and columns as attributes, using weather data as an example.
Explore how matrix dimension, or size, is defined by rows and columns, illustrated with two-by-three and two-by-two examples, and relate them to linear equations.
Learn to create matrices in Python with NumPy, using np.array to build 2d matrices, view their shape, and extract diagonals with diag for data science and machine learning applications.
Create matrices in python using numpy mat, building row-wise matrices from data such as weather tables, display with print, inspect shape, and extract diagonals with diag.
Learn to access and modify matrix elements in Python using zero-based indexing and NumPy. This lecture demonstrates indexing syntax, row and column access, and updating values.
Transpose the matrix to swap rows and columns, turning data represented as rows into columns, and learn that applying transpose to a transposed matrix returns the original matrix.
Transpose a 3 by 2 matrix to a 2 by 3 matrix using numpy’s T attribute, swapping rows and columns. Return the original matrix by transposing the transposed matrix.
Identify symmetric matrices as those equal to their transpose. Distinguish them from non-symmetric and rectangular matrices, and note that distance matrices have zero diagonal, illustrating symmetry.
Learn how to determine if a matrix is symmetric by comparing the matrix to its transpose with numpy. Check symmetry by comparing corresponding elements for equality and beware dimension mismatch.
Explore identity matrices as square matrices with ones on the diagonal and zeros elsewhere. Learn why multiplying any matrix by an identity matrix yields the original matrix.
Define diagonal matrices as square matrices with nonzero diagonal elements and zeros elsewhere, illustrated by 2x2, 3x3, and 4x4 examples; identity is diagonal, and some diagonal matrices are rectangular.
Learn to create diagonal matrices in numpy with non-zero diagonal elements using diagflat, and print 2x2 and 3x3 examples.
Identify upper and lower triangular matrices by their zero patterns around the diagonal. Learn the formal definitions: zeros below the diagonal for upper, zeros above for lower.
Explore zero matrices and ones matrices, understanding N by M matrices where all elements are zero or one, with examples of 2x2, 2x5, and 3x3 cases.
Create a three by three zero matrix and a three by three ones matrix using NumPy's zeros and ones functions, then print their contents.
Perform matrix addition by adding corresponding elements of matrices with the same dimensions, applied element-wise to A and B (e.g., two by two or two by three).
Perform element-wise matrix addition in Python by adding corresponding elements of two matrices with the same dimensions using numpy, creating A and B, then computing A plus B.
Practice scalar multiplication of matrices by multiplying every element by a scalar, producing a matrix of the same dimensions, illustrated with two by two and two by three examples.
Learn how to perform scalar multiplication on matrices in python with numpy, applying a scalar to each matrix element and displaying the resulting matrix.
Explore the Hadamard product, the element-wise multiplication of two matrices with identical dimensions, yielding a same-size result; illustrated with two by three matrices.
Compute the Hadamard product as element-wise multiplication of two matrices with the same dimensions. Use NumPy arrays created with the array function in Python.
Compute the trace by summing a matrix's diagonal elements to yield a scalar, illustrated with 2x2, 3x3, and 2x3 examples using A11, A22, and A33.
Learn to compute a matrix trace with numpy by summing diagonal elements. Import numpy as np, create matrices, use np.trace, and verify results such as 15 and 7.
Learn how matrix multiplication combines a 2x3 matrix with a 3x2 matrix to produce a 2x2 result via row-by-column dot products, not element-wise like addition.
Explore how to multiply matrices in Python by taking the dot product of rows of A with columns of B, using NumPy's mat and matmul to compute matrix C.
Explore the algebraic properties of matrix operations, including commutativity and associativity of addition, scalar distribution, left and right distributive laws, noncommutativity of multiplication, and transpose rules.
Explore matrix powers and how repeated multiplication forms A^k for n by n matrices. See that powers preserve dimensions, with examples like a 2x2 matrix yielding a 2x2 result.
Learn how to compute the matrix power using NumPy's linalg.matrix_power, with square matrices, and see practical examples that multiply a matrix by itself several times.
Multiply a diagonal matrix by another matrix, computing dot products to form the resultant, and observe that the diagonal elements scale the rows of the second matrix.
Explore diagonal matrix multiplication in Python: multiply A by B or B by A to see how diagonal elements scale rows or columns of the other matrix, using numpy arrays.
Compute determinants of square matrices using the two-by-two rule and three-by-three cofactors, then apply the checkerboard sign pattern and note singular matrices when the determinant is zero.
Use NumPy's linear algebra det function to compute determinants of square matrices, illustrated with 2x2 and 3x3 examples and results like six, negative seven, or zero.
Explore core determinant properties for square matrices, such as det(I)=1, det(A^T)=det(A), and det(AB)=det(A)det(B). Apply det(A^N)=det(A)^N and det(A)=1/det(A^{-1}) to simplify matrix operations.
Explore the inverse of a matrix, how it yields the identity when multiplied by the original, and that it exists for square matrices with determinant nonzero, computable via Gaussian elimination.
Learn how to compute the inverse of a square matrix in Python using NumPy's linear algebra inv function, with examples of 2x2 and 3x3 matrices.
Compute the determinant to decide if a square matrix is singular or invertible. A nonzero determinant yields an inverse; zero determinant makes the matrix singular and non-invertible.
Learn to determine if a matrix is singular or invertible by computing its determinant with numpy, and understand why a zero determinant means no inverse.
Explore properties of matrix inverses, including left and right inverses, inverse of inverse, invertibility of products, and the invertibility of transpose, with practical implications for linear algebra in data science.
Explore how linear algebra underpins data science and machine learning, using matrices and vectors to model data, solve systems of linear equations, and support preprocessing, transformation, and deep learning.
Explore how systems of linear equations yield a unique solution, infinitely many solutions, or no solution by graphing lines and identifying intersection points, with examples demonstrating consistency and inconsistency.
Explore how to represent systems of linear equations in matrix form using coefficient and augmented matrices, with examples solving two and three-variable cases via substitution, elimination, or graphs.
Explore elementary row operations, including interchange, scaling, and replacement, and learn how they preserve solutions when solving linear systems with augmented matrices.
Gaussian elimination with elementary row operations to transform an augmented matrix into row echelon form, then use back substitution to solve for x1, x2, and x3.
Learn the Gauss-Jordan elimination method to turn an augmented matrix into row reduced echelon form and solve a system of linear equations by row operations.
demonstrates solving a 3x3 linear system using gauss-jordan elimination in python to obtain reduced row echelon form with x1=2, x2=0, x3=-3.
Represent a system of linear equations as a matrix-vector product A x = B, where A contains coefficients and x the variables, yielding B as constants.
Represent a system of equations as Ax=B, where A is the coefficient matrix and x the unknowns. View the product Ax=B as a linear combination of A’s columns.
Explore how the matrix-vector product a x = b represents systems of linear equations, classify by M versus N (M=N, M<N, M>N), and identify when a unique solution exists.
Solve the system ax=b using the matrix inverse when A is a square, invertible matrix with a nonzero determinant. Then x equals A inverse b.
Solve systems of linear equations using the matrix inverse method in Python with NumPy, building matrix A and vector B, computing A inverse, and obtaining the solution vector X.
Solve systems of linear equations using Cramer's rule for a square invertible matrix A by replacing each column with B to compute x_i via determinants.
Solve a two-equation, two-unknown system using Cramer's rule. Represent the coefficients as matrix A and the constants as vector B to compute x1 and x2 via determinants.
Learn to solve systems of linear equations in Python with NumPy's linalg.solve by forming the coefficient matrix and the right-hand side vector, then computing the solution x.
Learn how vector length is measured by norms, including L2 (Euclidean distance), L1 (Manhattan distance), the general Lp norms, and max norm, with notes on robustness to outliers and sparsity.
Compute vector magnitude with the L2 norm, also known as Euclidean distance. It is the square root of the sum of squared components.
Compute the L2 norm, the Euclidean length, of vectors with numpy using np.linalg.norm, illustrated on v = [3,4] and w = [3,-2,5], yielding 5 and 6.164414.
Explore the L1 norm, or Manhattan distance, by summing the absolute values of a vector’s components, with examples in R2, R3, and beyond.
Learn how to compute the L1 norm, or Manhattan distance, of a vector using numpy's linalg.norm function with the argument 1, illustrated with vectors [3,4] and [3,-2,5].
Compute LP norm (p norm) of a vector, generalizing L1 and L2, using the p-th root of the sum of absolute components, with a p=4 example (3,4) yielding 4.285.
Compute the LP norm of vectors using numpy's linalg.norm, illustrating with v and w and p = 4, generalizing L1 and L2 norms.
Compute the l infinity norm, or max norm, by taking the maximum of a vector's components' absolute values, as shown with two and three component examples.
Compute the l infinity norm of vectors in numpy by taking the maximum absolute component using np.linalg.norm with inf, illustrated on vectors v and w.
This course will help you in understanding of the Linear Algebra and math’s behind Data Science and Machine Learning. Linear Algebra is the fundamental part of Data Science and Machine Learning. This course consists of lessons on each topic of Linear Algebra + the code or implementation of the Linear Algebra concepts or topics.
There’re tons of topics in this course. To begin the course:
We have a discussion on what is Linear Algebra and Why we need Linear Algebra
Then we move on to Getting Started with Python, where you will learn all about how to setup the Python environment, so that it’s easy for you to have a hands-on experience.
Then we get to the essence of this course;
Vectors & Operations on Vectors
Matrices & Operations on Matrices
Determinant and Inverse
Solving Systems of Linear Equations
Norms & Basis Vectors
Linear Independence
Matrix Factorization
Orthogonality
Eigenvalues and Eigenvectors
Singular Value Decomposition (SVD)
Again, in each of these sections you will find Python code demos and solved problems apart from the theoretical concepts of Linear Algebra.
You will also learn how to use the Python's numpy library which contains numerous functions for matrix computations and solving Linear Algebric problems.
So, let’s get started….