logo
episode-header-image
Feb 2017
28m 12s

MLG 008 Math for Machine Learning

OCDevel
About this episode

Mathematics essential for machine learning includes linear algebra, statistics, and calculus, each serving distinct purposes: linear algebra handles data representation and computation, statistics underpins the algorithms and evaluation, and calculus enables the optimization process. It is recommended to learn the necessary math alongside or after starting with practical machine learning tasks, using targeted resources as needed. In machine learning, linear algebra enables efficient manipulation of data structures like matrices and tensors, statistics informs model formulation and error evaluation, and calculus is applied in training models through processes such as gradient descent for optimization.

Links

Come back here after you've finished Ng's course; or learn these resources in tandem with ML (say 1 day a week).

Recommended Approach to Learning Math

  • Direct study of mathematics before beginning machine learning is not necessary; essential math concepts are introduced within most introductory courses.
  • A top-down approach, where one starts building machine learning models and learns the underlying math as needed, is effective for retaining and appreciating mathematical concepts.
  • Allocating a portion of learning time (such as one day per week or 20% of study time) to mathematics while pursuing machine learning is suggested for balanced progress.

Linear Algebra in Machine Learning

  • Linear algebra is fundamental for representing and manipulating data as matrices (spreadsheets of features and examples) and vectors (parameter lists like theta).
  • Every operation involving input features and learned parameters during model prediction and transformation leverages linear algebra, particularly matrix and vector multiplication.
  • The concept of tensors generalizes vectors (1D), matrices (2D), and higher-dimensional arrays; tensor operations are central to frameworks like TensorFlow.
  • Linear algebra enables operations that would otherwise require inefficient nested loops to be conducted quickly and efficiently via specialized computation (e.g., SIMD processing on CPUs/GPUs).

Statistics in Machine Learning

  • Machine learning algorithms and error measurement techniques are derived from statistics, making it the most complex math branch applied.
  • Hypothesis and loss functions, such as linear regression, logistic regression, and log-likelihood, originate from statistical formulas.
  • Statistics provides both the probability framework (modelling distributions of data, e.g., housing prices in a city) and inference mechanisms (predicting values for new data).
  • Statistics forms the set of "recipes" for model design and evaluation, dictating how data is analyzed and predictions are made.

Calculus and Optimization in Machine Learning

  • Calculus is used in the training or "learning" step through differentiation of loss functions, enabling parameter updates via techniques such as gradient descent.
  • The optimization process involves moving through the error space (visualized as valleys and peaks) to minimize prediction error, guided by derivative calculations indicating direction and magnitude of parameter updates.
  • The particular application of calculus in machine learning is called optimization, more specifically convex optimization, which focuses on finding minima in "cup-shaped" error graphs.
  • Calculus is generally conceptually accessible in this context, often relying on practical rules like the power rule or chain rule for finding derivatives of functions used in model training.

The Role of Mathematical Foundations Post-Practice

  • Greater depth in mathematics, including advanced topics and the theoretical underpinnings of statistical models and linear algebra, can be pursued after practical familiarity with machine learning tasks.
  • Revisiting math after hands-on machine learning experience leads to better contextual understanding and practical retention.

Resources for Learning Mathematics

  • MOOCs, such as Khan Academy, provide video lessons and exercises in calculus, statistics, and linear algebra suitable for foundational knowledge.
  • Textbooks recommended in academic and online communities cover each subject and are supplemented by concise primer PDFs focused on essentials relevant to machine learning.
  • Supplementary resources like The Great Courses offer audio-friendly lectures for deeper or alternative exposure to mathematical concepts, although they may require adaptation for audio-only consumption.
  • Audio courses are best used as supplementary material, with primary learning derived from video, textbooks, or interactive platforms.

Summary of Math Branches in Machine Learning Context

  • Linear algebra: manipulates matrices and tensors, enabling data structure operations and parameter computation throughout the model workflow.
  • Statistics: develops probability models and inference mechanisms, providing the basis for prediction functions and error assessments.
  • Calculus: applies differentiation for optimization of model parameters, facilitating the learning or training phase of machine learning via gradient descent.
  • Optimization: a direct application of calculus focused on minimizing error functions, generally incorporated alongside calculus learning.
Up next
Mar 2017
MLG 009 Deep Learning
<p><a href= "https://ocdevel.com/walk?utm_source=podcast&utm_medium=mlg&utm_campaign=mlg9"> Try a walking desk</a> to stay healthy while you study or work!</p> <p>Full notes at <a href= "htts://ocdevel.com/mlg/9?utm_source=podcast&utm_medium=mlg&utm_campaign=mlg9"> ocdevel.com/ml ... Show More
51m 28s
Mar 2017
MLG 010 Languages & Frameworks
<p><a href= "https://ocdevel.com/walk?utm_source=podcast&utm_medium=mlg&utm_campaign=mlg10"> Try a walking desk</a> to stay healthy while you study or work!</p> <p>Full notes at  <a href= "https://ocdevel.com/mlg/10?utm_source=podcast&utm_medium=mlg&utm_campaign=mlg10"> ocdevel.c ... Show More
44m 36s
Mar 2017
MLG 012 Shallow Algos 1
<p><a href= "https://ocdevel.com/walk?utm_source=podcast&utm_medium=mlg&utm_campaign=mlg12"> Try a walking desk</a> to stay healthy while you study or work!</p> <p>Full notes at <a href= "https://ocdevel.com/mlg/12?utm_source=podcast&utm_medium=mlg&utm_campaign=mlg12"> ocdevel.co ... Show More
53m 36s
Recommended Episodes
Sep 2024
Math for English Majors with Ben Orlin
Math & Language: Creativity, Quantification, and Making Math Accessible with Ben Orlin In this episode of Breaking Math, hosts sit down with Ben Orlin, author of Math for English Majors and Math with Bad Drawings, to explore the intersection of math and language. Discover the uni ... Show More
58m 44s
Jun 2020
Rust and machine learning #4: practical tools (Ep. 110)
<p>In this episode I make a non exhaustive list of machine learning tools and frameworks, written in Rust. Not all of them are mature enough for production environments. I believe that community effort can change this very quickly.</p> <p>To make a comparison with the Python ecos ... Show More
24m 18s
Apr 2017
Feature Processing for Text Analytics
It seems like every day there's more and more machine learning problems that involve learning on text data, but text itself makes for fairly lousy inputs to machine learning algorithms.  That's why there are text vectorization algorithms, which re-format text data so it's ready f ... Show More
17m 28s
Jul 2024
Les statistiques, c'est vraiment des maths ? (ta minute mathématique #2)
🎙️ Ta minute mathématique, ton nouveau rendez-vous de l'été. Une minute pour une notion simple de mathématique abordées sous forme de question que tu as toujours voulu poser sans jamais oser le demander.Rendez-vous tous les mercredis pendant l'été.Aujourd'hui : les statistiques, ... Show More
1m 52s
Jul 2019
Episode 67: Classic Computer Science Problems in Python
<p>Today I am with David Kopec, author of Classic Computer Science Problems in Python, published by Manning Publications.</p> <p>His book deepens your knowledge of problem solving techniques from the realm of computer science by challenging you with interesting and realistic scen ... Show More
28m 35s
Nov 2018
Vladimir Vapnik: Statistical Learning
Vladimir Vapnik is the co-inventor of support vector machines, support vector clustering, VC theory, and many foundational ideas in statistical learning. His work has been cited over 170,000 times. He has some very interesting ideas about artificial intelligence and the nature of ... Show More
54m 12s
Nov 2024
SE Radio 641: Catherine Nelson on Machine Learning in Data Science
<p><strong>Catherine Nelson</strong>, author of the new O'Reilly book, <em data-renderer-mark="true">Software Engineering for Data Scientists</em>, discusses the collaboration between data scientists and software engineers -- an increasingly common pairing on machine learning and ... Show More
48m 19s
Sep 2021
An Exploration Of The Data Engineering Requirements For Bioinformatics
<div class="wp-block-jetpack-markdown"><h2>Summary</h2> <p>Biology has been gaining a lot of attention in recent years, even before the pandemic. As an outgrowth of that popularity, a new field has grown up that pairs statistics and compuational analysis with scientific research ... Show More
55m 10s
Sep 9
What's New at CFI | Data Analysis in Python
Ready to take your data analysis skills to the next level? In this episode of What's New at CFI, we chat with subject matter expert Joseph Yeates about his newest course, Data Analysis in Python. This course is the perfect follow-up to our "Getting Started with Python" series and ... Show More
13m 33s