0% found this document useful (0 votes)
18 views16 pages

CS221 Machine Learning Overview

This document provides an overview of machine learning topics that will be covered in a course. It introduces classification, regression, and structured prediction as common machine learning tasks. For each task, it provides examples of real-world applications. It also outlines the course roadmap, which will cover linear and non-linear models, neural networks, considerations like generalization, and algorithms like stochastic gradient descent and backpropagation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views16 pages

CS221 Machine Learning Overview

This document provides an overview of machine learning topics that will be covered in a course. It introduces classification, regression, and structured prediction as common machine learning tasks. For each task, it provides examples of real-world applications. It also outlines the course roadmap, which will cover linear and non-linear models, neural networks, considerations like generalization, and algorithms like stochastic gradient descent and backpropagation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Machine learning: overview

• In this module, I will provide an overview of the topics we plan to cover under machine learning.
Course plan

Search problems Constraint satisfaction problems


Markov decision processes Markov networks
Adversarial games Bayesian networks

Reflex States Variables Logic


Low-level High-level

Machine learning

CS221 2
• Recall that machine learning is the process of turning data into a model. Then with that model, you can perform inference on it to make
predictions.
Course plan

Search problems Constraint satisfaction problems


Markov decision processes Markov networks
Adversarial games Bayesian networks
Reflex States Variables Logic
Low-level High-level

Machine learning

CS221 4
• While machine learning can be applied to any type of model, we will focus our attention on reflex-based models, which include models such
as linear classifiers and neural networks.
• In reflex-based models, inference (prediction) involves a fixed set of fast, feedforward operations.
Reflex-based models

predictor
input x y output
f

CS221 6
• Abstractly, a reflex-based model (which we will call a predictor f ) takes some input x and produces some output y.
• (In statistics, y is known as the response, and when x is a real vector, it is known as covariates or sometimes predictors, which is an unfortunate
naming clash.)
• The input can usually be arbitrary (an image or sentence), but the form of the output y is generally restricted, and what it is determines the
type of prediction task.
Binary classification
classifier
x y ∈ {+1, −1} label
f

Fraud detection: credit card transaction → fraud or no fraud

Toxic comments: online comment → toxic or not toxic

Higgs boson: measurements of event → decay event or background

Extension: multiclass classification: y ∈ {1, . . . , K}

CS221 8
• One common prediction task is binary classification, where the output y, typically expressed as positive (+1) or negative (-1).
• In the context of classification tasks, f is called a classifier and y is called a label (sometimes class, category, or tag).
• Here are some practical applications.
• One application is fraud detection: given information about a credit card transaction, predict whether it is a fradulent transaction or not, so
that the transaction can be blocked.
• Another application is moderating online discussion forums: given an online comment, predict whether it is toxic (and therefore should get
flagged or taken down) or not.
• A final application comes from physics: After the discovery of the Higgs boson, scientists were interested in how it decays. The Large Hadron
Collider at CERN smashes protons against each other and then detects the ensuing events. The goal is to predict whether each event is a
Higgs boson decaying (into two tau particles) or just background noise.
• Each of these applications has an associated Kaggle dataset. You can click on the pictures to find out more details.
• As an aside, multiclass classification is a generalization of binary classification where the output y could be one of K possible values. For
example, in digit classification, K = 10.
Regression

x f y∈R response

Poverty mapping: satellite image → asset wealth index

Housing: information about house → price

Arrival times: destination, weather, time → time of arrival

CS221 10
• The second major type of prediction task we’ll cover is regression. Here, the output y is a real number (often called the response or target).
• One application is poverty mapping: given a satellite image, predict the average asset wealth index of the homes in that area. This is used
to measure poverty across the world and determine which areas are in greatest need of aid.
• Another application: given information about a house (e.g., location, number of bedrooms), predict its price.
• A third application is to predict the arrival time of some service, which could be package deliveries, flights, or rideshares.
• The key distinction between classification and regression is that classification has discrete outputs (e.g., ”yes” or ”no” for binary classification),
whereas regression has continuous outputs.
Structured prediction

x f y is a complex object

Machine translation: English sentence → Japanese sentence

Dialogue: conversational history → next utterance

Image captioning: image → sentence describing image

Image segmentation: image → segmentation

CS221 12
• The final type of prediction task we will consider is structured prediction, which is a bit of a catch all.
• In structured prediction, the output y is a complex object, which could be a sentence or an image. So the space of possible outputs is huge.
• One application is machine translation: given an input sentence in one language, predict its translation into another language.
• Dialogue can be cast as structured prediction: given the past conversational history between a user and an agent (in the case of virtual
assistants), predict the next utterance (what the agent should say).
• In image captioning, say for visual assistive technologies: given an image, predict a sentence describing what is in that image.
• In image segmentation, which is needed to localize objects for autonomous driving: given an image of a scene, predict the segmentation of
that image into regions corresponding to objects in the world.
• Generating an image or a sentence can seem daunting, but there’s a secret here. A structured prediction task can often be broken up into a
sequence of multiclass classification tasks. For example, to predict an entire sentence, predict one word at a time, going left to right. This is
a very powerful reduction!
• Aside: one challenge with this approach is that the errors might cascade: if you start making errors, then you might go off the rails and start
making even more errors.
Roadmap
Models
Tasks
Non-linear features
Linear regression
Feature templates
Linear classification
Neural networks
K-means
Differentiable programming

Considerations
Algorithms
Group DRO
Stochastic gradient descent
Generalization
Backpropagation
CS221 Best practices 14
• Here are the rest of the modules under the machine learning unit.
• We will start by talking about regression and binary classification, the two most fundamental tasks in machine learning. Specifically, we study
the simplest setting: linear regression and linear classification, where we have linear models trained by gradient descent.
• Next, we will introduce stochastic gradient descent, and show that it can be much faster than vanilla gradient descent.
• We then take a careful look at the errors of a model and discuss group DRO, a technique that will make sure the errors don’t fall unevenly
on different groups of the population.
• Then we will push the limits of linear models by showing how you can define non-linear features, which effectively gives us non-linear
predictors using the machinery of linear models! Feature templates provide us with a framework for organizing the set of features.
• Then we introduce neural networks, which also provide non-linear predictors, but allow these non-linearities to be learned automatically from
data. We follow up immediately with backpropagation, an algorithm that allows us to automatically compute gradients needed for training
without having to take gradients manually.
• We then briefly discuss the extension of neural networks to differentiable programming, which allows us to easily build up many of the
existing state-of-the-art deep learning models in NLP and computer vision like lego blocks.
• So far we have focused on supervised learning. We take a brief detour and discuss K-means, which is a simple unsupervised learning algorithm
for clustering data points.
• We end on a more reflective note: Generalization is about answering the question: when does a model trained on set of training examples
actually generalize to new test inputs? This is where model complexity comes up. Finally, we discuss best practices for doing machine
learning in practice.

Common questions

Powered by AI

Binary classification involves predicting a discrete output, typically represented as positive (+1) or negative (-1), whereas regression involves predicting a continuous output, often called the response or target . Typical applications of binary classification include fraud detection (predicting if a transaction is fraudulent), moderating content (predicting if an online comment is toxic), and scientific experiments like identifying Higgs boson decay events . Applications of regression include predicting asset wealth indices from satellite images, housing prices based on property information, and arrival times of services .

The introduction of nonlinear features in neural networks significantly enhances model development and performance by enabling the capture of complex patterns and interactions within data that linear models cannot represent . The automatic learning of these features during training allows neural networks to flexibly adapt to various input characteristics, often resulting in superior predictive accuracy, especially for tasks involving significant nonlinearity like image recognition or language processing .

Stochastic gradient descent (SGD) improves upon standard gradient descent by significantly reducing the computation required per iteration, which results in faster convergence, especially for large datasets . Instead of using the entire dataset to calculate the gradient, SGD uses a randomly selected subset (a single data point or mini-batch), which reduces the time complexity per update and often leads to better generalization on unseen data .

The purpose of reflex-based models in machine learning is to perform fast, fixed feedforward operations to produce predictions, making them suitable for real-time decision-making tasks . These models function by taking an input (x), like an image or sentence, and applying a predefined function (f) to produce an output (y), like a binary class label or a continuous value .

Feature templates support the development of nonlinear predictors by organizing and transforming raw data into a structured input space that linear models can manipulate, effectively allowing the models to capture complex patterns . This approach leverages the simplicity and efficiency of linear models while extending their capability to handle nonlinearities, which can be beneficial for both interpretability and computational speed compared to deeper architectures like neural networks .

Unsupervised learning techniques like K-means are preferred over supervised learning approaches when labeled data is scarce or unavailable, making it impractical to train models with explicit input-output pairs . Such techniques are useful for discovering inherent structures, grouping similar data points, and dimensionality reduction, which can help in exploratory data analysis and pre-processing steps in larger pipelines .

Backpropagation plays a pivotal role in training neural networks by facilitating the efficient computation of the gradient of the loss function with respect to each weight in the network . It simplifies gradient computation by propagating the error terms backward through the network layers, using the chain rule for derivatives, thus avoiding manual gradient calculations and allowing for scalable training of deep models .

Structured prediction tasks are fundamentally different because they involve producing complex outputs, such as sentences or segmented images, which encompass a vast space of possible outputs compared to binary classification and regression, which have fixed or continuous outputs . Challenges associated with structured prediction include handling the potentially enormous space of outputs and managing error cascades, where initial errors can lead to further errors in predictions .

Errors in machine learning can be unevenly distributed across different demographic or categorical groups, potentially leading to biases in decision-making processes . Group DRO (Distributionally Robust Optimization) is a technique designed to address this issue by ensuring that errors do not disproportionately impact any particular group within the population, thus promoting fairness and equity in model predictions .

Ensuring that a machine learning model generalizes well to new test inputs is crucial for its applicability to real-world scenarios, where it must make accurate predictions on unseen data . Factors influencing a model's ability to generalize include the complexity of the model (to avoid overfitting), the quality and diversity of training data, and the choice of algorithms and hyperparameters, all of which can affect the balance between bias and variance in the model .

You might also like