Introduction to Linear Algebra and to Mathematics for Machine Learning
Introduction to Linear Algebra and Mathematics for Machine Learning
Introduction
- Professor: David Dye
- Lots of data in the world: need ways to make sense of it.
- Linear algebra (vector/matrix algebra) important in ML.
- Multivariate calculus is required to understand how something you're optimizes changes with respect to variables.
- Most DS and ML courses have these as a prerequisite: this course fills the gap.
Motivations for Linear Algebra
-
Price discovery by solving simultaneous equations:
-
Example of linear algebra problem: have constant linear coefficients 2, 3, 10, 1, that relate the input variables and to the output values 8 and 13.
-
If you had a vector that describes the price of apples and bananas:
-
Can write the equation as a matrix problem:
-
In this course, we'll learn how to solve this problem in the general case.
- Fitting an equation to some data:
- Useful for describing a population without requiring data.
Getting a handle on vectors
-
If you have a normal distribution with mean and standard deviation of a population, the function that plots the curve is as follows:
-
How do you find a function that finds the optimal and ?
- Determine some function that tells you how far off you are: eg sum of squared differences.
- Then, use calculus to walk toward the most optimal solution.
- Vectors don't just to describe objects in geometric space, they can describe directions along any sort of axis
- Can think of them as just lists.
- Space of all possible cars:
[cost_in_euros, emissions, top_speed, ...]
- Computer science view of vectors. See Vector.
- Spatial view is more familiar for physics.
- Einstein conceived of time being another dimension. Space-time is a 4-dimensional vector.
Operations with vectors
- Vector can be thought of as an object that moves about space.
- Space = physical space or data space.
- Example vector might include properties of a house: 120 sqm^2, 2 bedrooms, one bathroom, $150k:
[120, 2, 1, 150]
- Vector should obey two rules:
- We can add vectors (see Vector Addition).
- associative: doesn't matter what order you add
vector_1 + vector_2 = vector_2 + vector_1
- Since subtraction is just the addition of the negative, i.e.
r - r = r + (-r)
, the same rules apply to subtraction as addition.
- associative: doesn't matter what order you add
- We can multiply vectors by a scalar (see Vector Scaling).
- Multiples each value in the vector by some scalar:
2 * [1, 2] = [1 * 2, 2 * 2] = [2, 4]
- Multiples each value in the vector by some scalar:
- We can add vectors (see Vector Addition).