Tools 1.6The video for this lesson is on its way.
Everything else is ready: study the parts, the key terms and the quiz below.
- Part 11The feature matrix, and one prediction by hand
- Part 22The same prediction in a Python loop over every row
- Part 33X at w: the matrix product, every row at once
- Part 44Star is element wise, and at is the matrix product
- Part 55Transpose with dot T, and the two pieces the solve needs
- Part 66A one dimensional array has no orientation, and the None index
- Part 77The normal equations, and np dot linalg dot solve
- Part 88Why not np dot linalg dot inv: the condition number, and lstsq
- Part 99Checking the weights against scikit-learn
- Part 1010Recap and your challenge
Tools 1.6Code walkthrough10 parts
Linear Algebra in NumPy
Write the maths of the ML videos directly as code.
Loading your progress…Next: 1.7 Random Numbers and Reproducibility
In this lesson10 parts
- 01The feature matrix, and one prediction by hand
- 02The same prediction in a Python loop over every row
- 03X at w: the matrix product, every row at once
- 04Star is element wise, and at is the matrix product
- 05Transpose with dot T, and the two pieces the solve needs
- 06A one dimensional array has no orientation, and the None index
- 07The normal equations, and np dot linalg dot solve
- 08Why not np dot linalg dot inv: the condition number, and lstsq
- 09Checking the weights against scikit-learn
- 10Recap and your challenge
Key terms
The words this lesson introduces, each in one line. The module’s glossary collects them all.
- Transpose
- Exchange axes of a two-dimensional array
- Matrix product
- Row-column combination written
@ - Linear system
- Equations represented as
A @ w = b
Quiz 5 questions
Your first pick on each question is the one that counts, and a right one earns a coin. Getting one wrong here is how the lesson sticks.
Practice
Problems to solve in your own notebook. Each states the problem, not the steps: working out the steps is the exercise. Level A applies the lesson, B combines it with earlier ones, C stretches it.
The self-checking notebook for this lesson is Axes and linear algebra.
Where it’s used
Where this lesson’s ideas turn up in real work.
Builds on
This lesson stands on its own. These go deeper into what it uses.
- Maths Module 3