Linear Algebra for Data Representation
Probability theory describes two places where uncertainty appears: in the data itself and in the predictions a model makes. Both are handled with the same family of ideas.
Looking Beneath the Algorithms
Many introductions to machine learning start by showing what a method does and how it behaves, and they leave the underlying mathematics for later. That order is useful. It lets a newcomer build intuition about the most common algorithms before worrying about every equation. This article picks up where such an introduction usually stops and asks a simple question: if the algorithms can be understood intuitively, what mathematics sits underneath them?
What do you think happens?
Before reading on: a model is trained on measurements that vary from one sample to the next. Which of the three areas do you think is meant to describe that variation?
Reveal answer
Probability theory
The source says probability theory helps describe the uncertainty that appears in data and in model predictions. Variation between samples is a form of uncertainty, so probability is the area that supplies tools for it.
The source gives a direct answer to the question. Many of the models discussed in an introductory treatment rely on principles from three areas: probability theory, linear algebra, and optimization. The source also states that a practitioner does not need to master every implementation detail of these algorithms, but that knowing some of the theory behind them is valuable. The rest of this article explains each area in turn and shows how they fit together.
Three Parts of a Model
Think of a machine learning model as a machine built from several parts. Some parts describe how uncertain or noisy the data is. Some parts organize the data into a structured form so that it can be manipulated. Some parts decide how the model should change to become better at its task. The source places these three roles under the labels probability theory, linear algebra, and optimization. Each label names a body of mathematics that supplies tools for one of these roles.
The diagram is a simplification. Each foundation supplies principles to the same family of models, so one model can draw on more than one of them at once. The diagram does not claim that every model uses every foundation equally, and it does not claim that these three areas are the only mathematics involved. It only reflects the statement that many models use principles from all three.
Probability: Describing Uncertainty
The first foundation is probability theory, and the source states that many machine learning models use its principles. Probability gives a language for situations where the outcome is not fully known in advance. Data collected from the world almost always contains variation, and a model that makes predictions from such data has to deal with that variation somehow. Probability theory is one of the main mathematical tools for reasoning about that uncertainty.
Probability theory describes two places where uncertainty appears: in the data itself and in the predictions a model makes. Both are handled with the same family of ideas.
Linear Algebra: Data as Rows and Columns
The second foundation is linear algebra. It is concerned with collections of numbers arranged in ordered structures, and with the operations that can be performed on those structures. In machine learning, a dataset is often arranged in exactly this kind of ordered form: each example is one row of numbers, and each measured feature is one column. Linear algebra supplies the rules for working with such arrangements efficiently.
Reading a Small Dataset as a Matrix
A dataset has three samples, and each sample is measured on two features. How is it arranged, and where does each value sit?
- 1Choose the layout
Following the source's description, each sample is one row and each feature is one column.
- 2Fill the rows
Sample 1 gives the row of values 5.2 and 3. Sample 2 gives the row 4.8 and 7. Sample 3 gives the row 6.1 and 2.
- 3Locate a value
The value 7 is in row 2 and column 2. Reading the row gives one whole sample, and reading a column gives one feature across all samples.
The dataset is a three-by-two arrangement of numbers. Rows map back to samples and columns map back to features.
Optimization: Searching for Better Settings
The third foundation is optimization. In broad terms, optimization is about finding the best option from a set of possibilities according to some measure of quality. Learning in a machine learning model can be seen as a search of this kind. The model has settings, and those settings are adjusted so that its behavior on the training data becomes better by the chosen measure.
Mistakes Learners Make
Common mistake Believing that a model is built from only one of the three areas
Why it failsThe source says many models use principles from all three, and a single model can draw on more than one of them at once.
Do this insteadAsk which of the three roles each part of a model plays: describing uncertainty, organizing data, or searching for better settings.
Common mistake Reading the three-part diagram as a claim that every model uses every foundation equally
Why it failsThe source states the diagram is a simplification and does not claim equal use.
Do this insteadTreat the diagram as showing which tools are available, not how much each one is used in a given model.
Common mistake Assuming that understanding the theory is required before using an algorithm
Why it failsThe source says theory is valuable but not required before using algorithms intuitively.
Do this insteadStart with intuition, then return to the underlying mathematics as study deepens.
Why Theory Helps a Practitioner
The source states that a practitioner does not need to master every implementation detail of these algorithms. It also says that knowing some of the theory behind them is valuable. Theory gives a practitioner a way to reason about why a model behaves as it does: what its data is assumed to look like, how its settings are being searched, and what kind of uncertainty its predictions carry.
Build intuition about an algorithm first, then study the probability, linear algebra, or optimization behind it when you need to understand its behavior more deeply.
For deeper study, the source closes by recommending several books for readers who want to go further than an introductory treatment, and it advises reading at least one of them. The source gives a brief description of each recommendation. Look up those recommendations in the source itself to choose a starting point.
Practice: Matching Roles to Foundations
A learner has a dataset where each sample is a row and each feature is a column. Another part of the model must decide how the settings should change to do better on the training data. For each of these two tasks, name the foundation that supplies the tools, and explain your reason in one sentence.
Hints
- Ask which foundation is about ordered collections of numbers.
- Ask which foundation is about finding the best option according to a measure of quality.
Key Takeaways
- Many machine learning models use principles from three areas: probability theory, linear algebra, and optimization.
- Probability theory helps describe the uncertainty that appears in data and in model predictions.
- Linear algebra provides the tools for organizing data as collections of numbers, with samples as rows and features as columns, while optimization provides a way to search for better model settings.
- Understanding the theory behind algorithms is valuable, though it is not required before using them intuitively.