Skip to content

Chapter 1 of 8

Foundations of Machine Learning

Machine learning is broadly categorized by how learning signals are provided to the model. In supervised learning, models are trained on labeled data—each example pairs an input with a known correct output—and learn to predict labels for new inputs. Common supervised tasks include classification, which predicts discrete labels such as spam versus not spam, and regression, which predicts continuous values like house prices. In contrast, unsupervised learning trains on unlabeled data and requires the model to discover hidden structure such as clusters, low-dimensional manifolds, or outliers. Techniques such as k-means clustering and PCA fall into this category.

Beyond these two main paradigms, several other learning settings are widely used. Semi-supervised learning combines a small amount of labeled data with a large pool of unlabeled data, which is useful when labeling is expensive. Self-supervised learning goes further by generating its own supervision signal from the input—for example, predicting masked words or contrasting image transformations—and powers modern foundation models such as BERT and CLIP. Reinforcement learning involves an agent learning a policy by interacting with an environment to maximize a cumulative reward signal, as seen in game-playing AIs and robotics. Related paradigms include multi-task learning, where one model shares representations across several tasks, and transfer learning, where a pre-trained model is fine-tuned for a new but related task.

A practical distinction within supervised learning is between classification and regression. Classification outputs a category from a discrete set of classes, while regression outputs a real number. Logistic regression, despite its name, is a classification algorithm that uses the sigmoid function \( \sigma(x) = \frac{1}{1 + e^{-x}} \) to map a linear score into a probability between 0 and 1, applying a threshold (often 0.5) to assign a class label. Understanding which learning paradigm and task type fits a problem is the first step in any machine learning project.

All chapters
  1. 1Foundations of Machine Learning
  2. 2Classical Machine Learning Algorithms
  3. 3Model Training, Optimization, and Evaluation
  4. 4Feature Engineering and Data Preparation
  5. 5Deep Learning Foundations
  6. 6Specialized Neural Architectures
  7. 7NLP and Generative Models
  8. 8ML Systems and Applications

Drill it

Reading is not remembering. These come from the Machine Learning Programming deck:

Q

What is supervised learning?

Supervised learning is a type of machine learning where the model is trained on labeled data, meaning each training example includes an input and its correspond...

Q

What is unsupervised learning?

Unsupervised learning is a type of machine learning where the model is trained on unlabeled data and must discover hidden patterns or structures on its own. Com...

Q

What is the difference between classification and regression?

Classification predicts a discrete label (e.g., spam or not spam), while regression predicts a continuous value (e.g., house price). Classification outputs cate...

Q

What is linear regression?

Linear regression is a supervised learning algorithm that models the relationship between a dependent variable and one or more independent variables by fitting...