Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao...

32
Lecture 4: Binary Classification (I) Hao Helen Zhang September 16, 2020 Hao Helen Zhang Lecture 4: Binary Classification (I) 1/1

Transcript of Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao...

Page 1: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

Lecture 4: Binary Classification (I)

Hao Helen Zhang

September 16, 2020

Hao Helen Zhang Lecture 4: Binary Classification (I) 1 / 1

Page 2: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

Binary Classification

Basic problem set-up binary classifiers

Optimal classifier: under equal costs

Optimal classifier: under unequal costs

Simple linear classifiers

Hao Helen Zhang Lecture 4: Binary Classification (I) 2 / 1

Page 3: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

General Setup

input vector X ∈ X ⊂ Rd

output Y ∈ 0, 1the goal is to construct a function f : X −→ 0, 1

A classification rule is often characterized as

f (X ) = I (b(X ) > 0),

where b(X ) is the boundary between two classes.

If b(X ) is a linear in X , then the classifier has a linear boundary. Itis called a linear classification rule.

Hao Helen Zhang Lecture 4: Binary Classification (I) 3 / 1

Page 4: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

Elements of Statisti al Learning Hastie, Tibshirani & Friedman 2001 Chapter 2Linear Regression of 0/1 Response

.. . . . . .. . . . . . . . . . . .. . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . .. . . . . . . .. .

oo

ooo

o

o

o

o

o

o

o

o

oo

o

o o

o

o

o

o

o

o

o

o

o

o

o

o

o

o

oo

o

o

o

o

o

o

o

o

o

o

o

o

o

o

o

o

o

o

o

o

o

o

o

o

oo

o

o

o

o

o

o

o

o

o

oo o

oo

oo

o

oo

o

o

o

oo

o

o

o

o

o

o

o

o

o

o

o

o

oo

o

o

o

oo

o

o

o

o

o

oo

o

o

o

o

o

o

o

oo

o

o

o

o

o

o

o

o ooo

o

o

ooo o

o

o

o

o

o

o

o

oo

o

o

oo

ooo

o

o

ooo

o

o

o

o

o

o

o

oo

o

o

o

o

o

o

oo

ooo

o

o

o

o

o

o

oo

oo

oo

o

o

o

o

o

o

o

o

o

o

o

Figure 2.1: A lassi ation example in two dimen-sions. The lasses are oded as a binary variable|GREEN = 0; RED = 1|and then t by linear regression.The line is the de ision boundary dened by xT = 0:5.The red shaded region denotes that part of input spa e lassied as RED, while the green region is lassied asGREEN.

Hao Helen Zhang Lecture 4: Binary Classification (I) 4 / 1

Page 5: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

Probability Framework

Both X and Y are random quantities.

Their distributions can be specified by

marginal distribution of Y prior class probabilities:

π1 = P(Y = 1), π0 = P(Y = 0)

conditional density of X given Y (class distributions):

X |Y = 1 ∼ g1(x), X |Y = 0 ∼ g0(x)

Hao Helen Zhang Lecture 4: Binary Classification (I) 5 / 1

Page 6: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

Probability Framework

From the above, we can derive

marginal density of X (a mixture):

g(x) = π1g1(x) + π0g0(x)

conditional dist of Y given X (posterior class probability)

P(Y = 1|X = x) =π1g1(x)

g(x),

P(Y = 0|X = x) = 1− P(Y = 1|X = x) =π0g0(x)

g(x).

Hao Helen Zhang Lecture 4: Binary Classification (I) 6 / 1

Page 7: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

Scenario 1

Generate 100 observations from BVN(µ1,Σ1) with Σ1 = I(the identity matrix), and label them as Green (Class 1);

Generate 100 observations from BVN(µ0,Σ0) with Σ0 = I,and label them as Red (Class 0).

Two classes have the same prior probabilities.Write down their distributions.

π0 = π1 = 0.5, X |Y = 1 ∼ g1(x), X |Y = 0 ∼ g0(x),

g1(x) = (2π)−1 exp−1

2[(x1 − µ11)2 + (x2 − µ12)2]

g0(x) = (2π)−1 exp−1

2[(x1 − µ01)2 + (x2 − µ02)2].

The marginal pdf of X is

g(x) = 0.5g0(x) + 0.5g1(x).

Hao Helen Zhang Lecture 4: Binary Classification (I) 7 / 1

Page 8: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

Scenario 1

Generate 100 observations from BVN(µ1,Σ1) with Σ1 = I(the identity matrix), and label them as Green (Class 1);

Generate 100 observations from BVN(µ0,Σ0) with Σ0 = I,and label them as Red (Class 0).

Two classes have the same prior probabilities.Write down their distributions.

π0 = π1 = 0.5, X |Y = 1 ∼ g1(x), X |Y = 0 ∼ g0(x),

g1(x) = (2π)−1 exp−1

2[(x1 − µ11)2 + (x2 − µ12)2]

g0(x) = (2π)−1 exp−1

2[(x1 − µ01)2 + (x2 − µ02)2].

The marginal pdf of X is

g(x) = 0.5g0(x) + 0.5g1(x).

Hao Helen Zhang Lecture 4: Binary Classification (I) 7 / 1

Page 9: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

Bayes (Optimal) Rule under 0-1 Cost

For any f , we measure its performance under 0-1 loss by its risk

R(f ) = EPE (f ) = EX ,Y I (Y 6= f (X )) = P(Y 6= X ).

The Bayes rule is f ∗, defined as f ∗ = arg minf R(f ) and given by

f ∗(x) =

1 if P(Y = 1|X = x) > P(Y = 0|X = x)

0 if P(Y = 1|X = x) < P(Y = 0|X = x).

We sometimes denote the Bayes rule as φB .

φB minimizes the probability of making an error.

The classification boundary of the Bayes rule is

x : P(Y = 1|X = x) = P(Y = 0|X = x)= x : P(Y = 1|X = x)− 0.5 = 0.

Hao Helen Zhang Lecture 4: Binary Classification (I) 8 / 1

Page 10: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

Prior Class Probabilities (π)

reflect prior knowledge of the proportion of each class

can be used to make a decision without any extra knowledge

If there is no information regarding x and only the priorprobabilities are available, a natural classifier would be

f = 1, if π1 > π0; f = 0, otherwise;

If π1 = π0, we assign the sample randomly to one class.

This f classifies all the data points to one class

This f minimizes the probability of making an error

Hao Helen Zhang Lecture 4: Binary Classification (I) 9 / 1

Page 11: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

Rare Disease Example

Example: Assume a certain rare disease occurs among 1% of thepopulation. Now a person comes and we do not have any extrainformation about him/her. What is your prediction rule?

Define Class 1 = “disease”, 0= “disease-free”. Since

1% = π1 < π0 = 99%,

our classification rule isf ≡ 0.

Compute its risk under 0-1 loss.

Answer:

EPE (f ) = P(Y 6= f ) = P(Y 6= 0) = P(Y = 1) = 1%.

We have used the Prior Class probabilities to make a prediction.

Hao Helen Zhang Lecture 4: Binary Classification (I) 10 / 1

Page 12: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

Rare Disease Example

Example: Assume a certain rare disease occurs among 1% of thepopulation. Now a person comes and we do not have any extrainformation about him/her. What is your prediction rule?

Define Class 1 = “disease”, 0= “disease-free”. Since

1% = π1 < π0 = 99%,

our classification rule isf ≡ 0.

Compute its risk under 0-1 loss.

Answer:

EPE (f ) = P(Y 6= f ) = P(Y 6= 0) = P(Y = 1) = 1%.

We have used the Prior Class probabilities to make a prediction.

Hao Helen Zhang Lecture 4: Binary Classification (I) 10 / 1

Page 13: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

Posterior Class Probabilities

Recall the Bayes rule is

f (x) = I (P(Y = 1|X = x) > P(Y = 0|X = x)).

posterior class probabilities P(Y = j |X = x) provide updatedclass probabilities after observing x .

If P(Y = 1|X = x) = 0.5, we randomly assign data to oneclass.

Hao Helen Zhang Lecture 4: Binary Classification (I) 11 / 1

Page 14: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

Rare Disease Example (cont.)

Example: Assume a certain rare disease occurs among 1% of thepopulation. There is a test for this disease that is 99% accurate inthe sense: 99.5% of the disease will test positive, and only 0.5% ofthe disease-free group will test positive. (We assume the falsepositive and false negative rate are both 0.005.) Now a personcomes with a positive test result. What is your prediction rule?

Hao Helen Zhang Lecture 4: Binary Classification (I) 12 / 1

Page 15: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

Prior Probabilities and Class Densities

Class 1 = “disease”Class 0 = “disease-free”.

The covariate x takes only two values,

tested as “+”, tested as “-”

We haveπ1 = 1%, π0 = 99%.

And

P(X = +|Y = 1) = 0.995, P(X = −|Y = 1) = 0.005,

P(X = +|Y = 0) = 0.005, P(X = −|Y = 0) = 0.995.

Hao Helen Zhang Lecture 4: Binary Classification (I) 13 / 1

Page 16: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

Compute Posterior Probabilities

Using Bayes’ Theorem,

P(Y = 1|X = +)

=P(X = +|Y = 1)P(Y = 1)

P(X = +|Y = 1)P(Y = 1) + P(X = +|Y = 0)P(Y = 0)

=0.995 ∗ 0.01

0.995 ∗ 0.01 + 0.005 ∗ 0.99= 0.668.

Since P(Y = 0|X = +) = 0.332 < 0.668, the Bayes rule for aperson with “+” is f (x = +) = 1.

Similarly, P(Y = 0|X = −) = 0.9999,P(Y = 1|X = −) = 0.0001,so f (x = −) = 0.

Hao Helen Zhang Lecture 4: Binary Classification (I) 14 / 1

Page 17: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

Partition Induced by f

Any learner f divides the whole input space as

X = Ω1 ∪ Ω0,

where each Ωj represents the “territory” of class j specified by f .

Ωj = x ∈ X : f (x) = j, j = 0, 1.

Therefore, f can be characterized as the indicator function

f (x) = I (x ∈ Ω1).

Hao Helen Zhang Lecture 4: Binary Classification (I) 15 / 1

Page 18: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

Likelihood Ratio Connection

Recall that P(Y = 1|X = x) = π0g0(x)/(π0g0(x) + πg1(x)).The Bayes rule can be expressed as

f ∗(x) =

1 if g1(x)

g0(x)> π0

π1,

0 if g1(x)g0(x)

< π0π1.

The Bayes decision boundary is given by

x :g1(x)

g0(x)=π0π1.

Here l(x) = g1(x)g0(x)

is known as the likelihood ratio.

Hao Helen Zhang Lecture 4: Binary Classification (I) 16 / 1

Page 19: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

Example 1

Consider the equal cost situation:

π1 = π0 = 0.5 (balanced classes)

g1(x) = φ(x ;µ = 0, σ = 1)

g0(x) = 0.65φ(x ;µ = 1, σ = 1) + 0.35φ(x ;µ = −1, σ = 2)

The Bayes boundary is

x :g1(x)

g0(x)= 1 = −1.89, 0.76.

So the optimal classification regions are

Ω∗1 = (−1.89, 0.76), Ω∗0 = (−∞,−1.89) ∪ (0.76,∞).

Hao Helen Zhang Lecture 4: Binary Classification (I) 17 / 1

Page 20: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

−4 −2 0 2 4

0.00.1

0.20.3

0.4

Conditional Densities

x

densi

ty

−4 −2 0 2 4

0.00.5

1.01.5

2.0

Likelihood ratio

x

ratio

Pi_0/Pi_1

−4 −2 0 2 4

0.60.8

1.01.2

1.4

x

class 1class 2

Hao Helen Zhang Lecture 4: Binary Classification (I) 18 / 1

Page 21: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

Classification Error & Cost

For any decision function, there are two possible errors:

misclassifying a sample in class 0 to 1 (false positive)

misclassifying a sample in class 1 to 0 (false negative)

Each type of error is associated with a cost (the price to pay forthe consequence):

C (1, 0) is the cost of misclassifying a sample in class 1 to 0C (0, 1) is the cost of misclassifying a sample in class 0 to 1

Typically, we assume C (i , j) ≥ 0 for any i , j . And C (j , j) = 0 forj = 0, 1.

Hao Helen Zhang Lecture 4: Binary Classification (I) 19 / 1

Page 22: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

Unequal Costs and Prediction Risk Function

Assume C (0, 1) 6= C (1, 0). The loss becomes

L = C (1, 0)I (Y = 1, f (X ) = 0) + C (0, 1)I (Y = 0, f (X ) = 1).

For any learner f , its prediction risk is calculated as

R(f ) = EXEY |XL(Y , f (X ))

= EX [C (1, 0)P(Y = 1|X )I (f (X ) = 0)

+ C (0, 1)P(Y = 0|X )I (f (X ) = 1)]

Hao Helen Zhang Lecture 4: Binary Classification (I) 20 / 1

Page 23: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

Optimal Learner Under Unequal Costs

For fixed x , the Bayes rule is given as

f ∗(x) =

1 if C (1, 0)P(Y = 1|X = x) > C (0, 1)P(Y = 0|X = x)

0 if C (1, 0)P(Y = 1|X = x) < C (0, 1)P(Y = 0|X = x).

Or, equivalently,

f ∗(x) =

1 if P(Y=1|X=x)

P(Y=0|X=x) >C(0,1)C(1,0) ,

0 if P(Y=1|X=x)P(Y=0|X=x) <

C(0,1)C(1,0)) .

Hao Helen Zhang Lecture 4: Binary Classification (I) 21 / 1

Page 24: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

Unequal Costs for Two-Class Problems

Alternatively, the Bayes rule is expressed as

φB(x) =

1 if P(Y = 1|X = x) > C(0,1)

C(1,0)+C(0,1)

0 o.w..

When C (0, 1) C (1, 0), the thresholding value is close to 1,thus tend to classify any object to class 0.

When C (1, 0) C (0, 1), the thresholding value is close to 0,thus tend to classify any object to class 1.

Hao Helen Zhang Lecture 4: Binary Classification (I) 22 / 1

Page 25: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

Bayes Boundary for Unequal Costs

Using the likelihood ratio, the Bayes rule can be expressed as

f ∗(x) =

1 if g1(x)

g0(x)> π0C(0,1)

π1C(1,0) ,

0 if g1(x)g0(x)

< π0C(0,1)π1C(1,0) .

The Bayes decision boundary is given by

x :P(Y = 1|X = x)

P(Y = 0|X = x)=

C (0, 1)

C (1, 0)

= x :g1(x)

g0(x)=π0C (0, 1)

π1C (1, 0)

= x : l(x) =π0C (0, 1)

π1C (1, 0)

Hao Helen Zhang Lecture 4: Binary Classification (I) 23 / 1

Page 26: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

Revisit Example 1 (with unequal costs)

For Example 1, assume unequal costs are used as:

C (0, 1) = 2,C (1, 0) = 1.

The Bayes boundary becomes

x :g1(x)

g0(x)= 2 = −1.28,−0.16.

So the optimal classification regions are

Ω∗1 = (−1.28,−0.16), Ω∗0 = (−∞,−1.28) ∪ (−0.16,∞).

Comment: Due to the larger cost for misclassifying class 0 to 1, thedecision is more protective class 0: shrinking Ω∗1 and expanding Ω∗0.

Hao Helen Zhang Lecture 4: Binary Classification (I) 24 / 1

Page 27: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

−4 −2 0 2 4

0.00.1

0.20.3

0.4

Conditional Densities

x

densi

ty

−4 −2 0 2 4

0.00.5

1.01.5

2.0

Likelihood ratio (unequal cost)

x

ratio

Pi_0C(0,1)/Pi_1C(1,0)

−4 −2 0 2 4

0.60.8

1.01.2

1.4

x

class 1class 2

Hao Helen Zhang Lecture 4: Binary Classification (I) 25 / 1

Page 28: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

Fisher Consistency

Desired properties of a classifier: Fisher consistency

A binary classifier produced from loss L(Y , f (X )) is Fisherconsistent, the minimizer of E [L(Y , f (X ))|X = x ] has thesame sign as the Bayes rule.

In other words, Fisher consistency requires the loss functionasymptotically yields the Bayes decision boundary.

We will talk about Fisher consistency of various losses later.

Hao Helen Zhang Lecture 4: Binary Classification (I) 26 / 1

Page 29: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

Linear Regression Models

Assume E (Y |x) = P(Y = 1|x) = β0 + xTβ1.

Let β = (β0,βT1 )T .

Ordinary least square (OLS) estimator is minimizer of

RSS(β) = ‖y − Xβ‖2 = (y − Xβ)T (y − Xβ),

y = (y1, · · · , yn)T , with each yi ∈ 0, 1.X is the design matrix, with the first column being 1’s.

The minimizer isβOLS

= (XTX )−1XT y.

Hao Helen Zhang Lecture 4: Binary Classification (I) 27 / 1

Page 30: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

Linear Classification Rule

Classification Rule: given any input x , compute

b(x) = βOLS0 + xT β

OLS

1 − 0.5

The, the predicted label is given by

y = f (x) =

1 if b(x) > 0

0 if b(x) < 0,

Hao Helen Zhang Lecture 4: Binary Classification (I) 28 / 1

Page 31: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

Elements of Statisti al Learning Hastie, Tibshirani & Friedman 2001 Chapter 2Linear Regression of 0/1 Response

.. . . . . .. . . . . . . . . . . .. . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . .. . . . . . . .. .

oo

ooo

o

o

o

o

o

o

o

o

oo

o

o o

o

o

o

o

o

o

o

o

o

o

o

o

o

o

oo

o

o

o

o

o

o

o

o

o

o

o

o

o

o

o

o

o

o

o

o

o

o

o

o

oo

o

o

o

o

o

o

o

o

o

oo o

oo

oo

o

oo

o

o

o

oo

o

o

o

o

o

o

o

o

o

o

o

o

oo

o

o

o

oo

o

o

o

o

o

oo

o

o

o

o

o

o

o

oo

o

o

o

o

o

o

o

o ooo

o

o

ooo o

o

o

o

o

o

o

o

oo

o

o

oo

ooo

o

o

ooo

o

o

o

o

o

o

o

oo

o

o

o

o

o

o

oo

ooo

o

o

o

o

o

o

oo

oo

oo

o

o

o

o

o

o

o

o

o

o

o

Figure 2.1: A lassi ation example in two dimen-sions. The lasses are oded as a binary variable|GREEN = 0; RED = 1|and then t by linear regression.The line is the de ision boundary dened by xT = 0:5.The red shaded region denotes that part of input spa e lassied as RED, while the green region is lassied asGREEN.

Hao Helen Zhang Lecture 4: Binary Classification (I) 29 / 1

Page 32: Lecture 4: Binary Classi cation (I) - University of Arizonahzhang/math574m/2020F_Lect4_binary.pdfHao Helen Zhang Lecture 4: Binary Classi cation (I) 10/1. Rare Disease Example Example:

Comments on Linear Models

Advantages:

simple - fitting and making inferences

the estimate is smooth

in general, low variance

Limitations:

rely heavily on linear assumption

not robust against outliers

potentially high bias

Hao Helen Zhang Lecture 4: Binary Classification (I) 30 / 1