02-Regression-I Machine Learning
02-Regression-I Machine Learning
training examples
This is called,
classification when the target variables are discrete and
regression when the target features are continuous.
Inputs Outputs
Goal: Find a hypothesis ℎ in hypothesis class 𝐻 that performs
a good job of mapping 𝑥 to 𝑦.
Supervised
Learning
x2 Unsupervised
Learning
x1
Applications:
Game playing
Robot in a maze
Classification
Predict discrete‐valued output
Example: Credit scoring
Differentiating between low-
risk and high-risk customers
from their income and savings
Discriminant Model:
IF income > θ1 AND savings > θ2
THEN low-risk
ELSE high-risk
Regression
Predict real-valued output
y: Price
Learn the program that fits
the function to training
examples to learn Y as the
function of X.
𝒚 = 𝜽𝟎 + 𝜽𝟏 𝒙
x: Mileage
α1
Classification
Y is discrete, a (small) finite, unordered set of classes
𝑒𝑟𝑟𝑜𝑟 ℎ 𝑥 , 𝑓 𝑥 = 0 if ℎ 𝑥 = 𝑓 𝑥 else 1
0-1 Loss Error
Regression
Y is continuous, a numeric set (typically real numbers)
𝑒𝑟𝑟𝑜𝑟 ℎ 𝑥 , 𝑓 𝑥 = (ℎ 𝑥 − 𝑓 𝑥 )2
Squared Error
Dr. Hashim Yasin Applied Machine Learning (CS4104)
LINEAR REGRESSION
Linear Regression with one Variable
22
Housing Prices
(Portland, OR)
of dollars)
(in 1000s
Price
Size (feet2)
Supervised Learning Regression Problem
Given the “right answer” for Predict real-valued output
each example in the data.
Dr. Hashim Yasin Applied Machine Learning (CS4104)
Regression Example
23
Training Set
Learning Algorithm
Size of Estimated
house (X)
h price (Y)
Hypothesis:
‘s: Parameters
How to choose ‘s ?
Dr. Hashim Yasin Applied Machine Learning (CS4104)
Regression
26
𝑐ℎ𝑎𝑛𝑔𝑒 𝑖𝑛 𝑌
𝑦 = 𝜃0 + 𝜃1 𝑥 𝜃=
𝑐ℎ𝑎𝑛𝑔𝑒 𝑖𝑛 𝑋
𝜃1 = 0.5, 𝜃0 = 1 𝜃1 = 0, 𝜃0 = 1.5
𝑐ℎ𝑎𝑛𝑔𝑒 𝑖𝑛 𝑌
𝑦 = 𝜃1 𝑥 + 𝜃0 𝜃=
𝑐ℎ𝑎𝑛𝑔𝑒 𝑖𝑛 𝑋
𝜃1 = 2, 𝜃0 = 1 𝜃1 = 1, 𝜃0 = 0
Simplified:
Hypothesis:
Parameters:
Cost Function:
Goal: