<< Chapter < Page Chapter >> Page >

Pattern classification

Recall that the goal of classification is to learn a mapping from the feature space, X , to a label space, Y . This mapping, f , is called a classifier . For example, we might have

X = R d Y = { 0 , 1 } .

We can measure the loss of our classifier using 0 - 1 loss; i.e.,

( y ^ , y ) = 1 { y ^ y } = { 1 , y ^ y 0 , y ^ = y .

Recalling that risk is defined to be the expected value of the loss function, we have

R ( f ) = E X Y ( f ( X ) , Y ) = E X Y 1 { f ( X ) Y } = P X Y f ( X ) Y .

The performance of a given classifier can be evaluated in terms of how close its risk is to the Bayes' risk.

(Bayes' Risk)
The Bayes' risk is the infimum of the risk for all classifiers:
R * = inf f R ( f ) .
We can prove that the Bayes risk is achieved by the Bayes classifier.
Bayes Classifier
The Bayes classifier is the following mapping:
f * ( x ) = 1 , η ( x ) 1 / 2 0 , o t h e r w i s e
where
η ( x ) P Y | X ( Y = 1 | X = x ) .
Note that for any x , f * ( x ) is the value of y { 0 , 1 } that maximizes P X Y ( Y = y | X = x ) .
Theorem

Risk of the bayes classifier

R ( f * ) = R * .

Let g ( x ) be any classifier. We will show that

P ( g ( X ) Y | X = x ) P ( f * ( x ) Y | X = x ) .

For any g ,

P ( g ( X ) Y | X = x ) = 1 - P Y = g ( X ) | X = x = 1 - P Y = 1 , g ( X ) = 1 | X = x + P Y = 0 , g ( X ) = 0 | X = x = 1 - E [ 1 { Y = 1 } 1 { g ( X ) = 1 } | X = x ] + E [ 1 { Y = 0 } 1 { g ( X ) = 0 } | X = x ] = 1 - 1 { g ( x ) = 1 } E [ 1 { Y = 1 } | X = x ] + 1 { g ( x ) = 0 } E [ 1 { Y = 0 } | X = x ] = 1 - 1 { g ( x ) = 1 } P Y = 1 | X = x + 1 { g ( x ) = 0 } P Y = 0 | X = x = 1 - 1 { g ( x ) = 1 } η ( x ) + 1 { g ( x ) = 0 } 1 - η ( x ) .

Next consider the difference

P g ( x ) Y | X = x - P f * ( x ) Y | X = x = η ( x ) 1 { f * ( x ) = 1 } - 1 { g ( x ) = 1 } + ( 1 - η ( x ) ) 1 { f * ( x ) = 0 } - 1 { g ( x ) = 0 } = η ( x ) 1 { f * ( x ) = 1 } - 1 { g ( x ) = 1 } - ( 1 - η ( x ) ) 1 { f * ( x ) = 1 } - 1 { g ( x ) = 1 } = 2 η ( x ) - 1 1 { f * ( x ) = 1 } - 1 { g ( x ) = 1 } ,

where the second equality follows by noting that 1 { g ( x ) = 0 } = 1 - 1 { g ( x ) = 1 } . Next recall

f * ( x ) = 1 , η ( x ) 1 / 2 0 , o t h e r w i s e .

For x such that η ( x ) 1 / 2 , we have

( 2 η ( x ) - 1 ) 0 1 { f * ( x ) = 1 } 1 - 1 { g ( x ) = 1 } 0 o r 1 0

and for x such that η ( x ) < 1 / 2 , we have

( 2 η ( x ) - 1 ) < 0 1 { f * ( x ) = 1 } 0 - 1 { g ( x ) = 1 } 0 o r 1 0 ,

which implies

2 η ( x ) - 1 1 { f * ( x ) = 1 } - 1 { g ( x ) = 1 } 0

or

P ( g ( X ) Y | X = x ) P ( f * ( x ) Y | X = x ) .

Note that while the Bayes classifier achieves the Bayes risk, in practice this classifier is not realizable because we do not know the distribution P X Y and so cannot construct η ( x ) .

Regression

The goal of regression is to learn a mapping from the input space, X , to the output space, Y . This mapping, f , is called a estimator . For example, we might have

X = R d Y = R .

We can measure the loss of our estimator using squared error loss; i.e.,

( y ^ , y ) = ( y - y ^ ) 2 .

Recalling that risk is defined to be the expected value of the loss function, we have

R ( f ) = E X Y [ ( f ( X ) , Y ) ] = E X Y [ ( f ( X ) - Y ) 2 ] .

The performance of a given estimator can be evaluated in terms of how close the risk is to the infimum of the risk for all estimator under consideration:

R * = inf f R ( f ) .
Theorem

Minimum risk under squared error loss (mse)

Let f * ( x ) = E Y | X [ Y | X = x ]

R ( f * ) = R * .
R ( f ) = E X Y ( f ( X ) - Y ) 2 = E X E Y | X ( f ( X ) - Y ) 2 | X = E X E Y | X ( f ( X ) - E Y | X [ Y | X ] + E Y | X [ Y | X ] - Y ) 2 | X = E X [ E Y | X [ ( f ( X ) - E Y | X [ Y | X ] ) 2 | X ] + 2 E Y | X ( f ( X ) - E Y | X [ Y | X ] ) ( E Y | X [ Y | X ] - Y ) | X + E Y | X [ ( E Y | X [ Y | X ] - Y ) 2 | X ] ] = E X [ E Y | X [ ( f ( X ) - E Y | X [ Y | X ] ) 2 | X ] + 2 ( f ( X ) - E Y | X [ Y | X ] ) × 0 + E Y | X [ ( E Y | X [ Y | X ] - Y ) 2 | X ] ] = E X Y ( f ( X ) - E Y | X [ Y | X ] ) 2 + R ( f * ) .

Thus if f * ( x ) = E Y | X [ Y | X = x ] , then R ( f * ) = R * , as desired.  

Empirical risk minimization

Empirical Risk
Let { X i , Y i } i = 1 n i i d P X Y be a collection of training data. Then the empirical risk is defined as
R ^ n ( f ) = 1 n i = 1 n ( f ( X i ) , Y i ) .
Empirical risk minimization is the process of choosing a learning rule which minimizes the empirical risk; i.e.,
f ^ n = arg min f F R ^ n ( f ) .

Pattern classification

Let the set of possible classifiers be

F = x sign ( w ' x ) : w R d

and let the feature space, X , be [ 0 , 1 ] d or R d . If we use the notation f w ( x ) sign ( w ' x ) , then the set of classifiers can be alternatively represented as

F = f w : w R d .

In this case, the classifier which minimizes the empirical risk is

f ^ n = arg min f F R ^ n ( f ) = arg min w R d 1 n i = 1 n 1 { sign ( w ' X i ) Y i } .
Example linear classifier for two-class problem.

Regression

Let the feature space be

X = [ 0 , 1 ]

and let the set of possible estimators be

F = degree d polynomials on [ 0 , 1 ] .

In this case, the classifier which minimizes the empirical risk is

f ^ n = arg min f F R ^ n ( f ) = arg min f F 1 n i = 1 n ( f ( X i ) - Y i ) 2 .

Alternatively, this can be expressed as

w ^ = arg min w R d + 1 1 n i = 1 n ( w 0 + w 1 X i + ... + w d X i d - Y i ) 2 = arg min w R d + 1 V w - Y 2

where V is the Vandermonde matrix

V = 1 X 1 ... X 1 d 1 X 2 ... X 2 d 1 X n ... X n d .

The pseudoinverse can be used to solve for w ^ :

w ^ = ( V ' V ) - 1 V ' Y .

A polynomial estimate is displayed in [link] .

Example polynomial estimator. Blue curve denotes f * , magenta curve is the polynomial fit to the data (denoted by dots).

Overfitting

Suppose F , our collection of candidate functions, is very large. We can always make

min f F R ^ n ( f )

smaller by increasing the cardinality of F , thereby providing more possibilities to fit to the data.

Consider this extreme example: Let F be all measurable functions. Then every function f for which

f ( x ) = Y i , x = X i for i = 1 , ... , n any value , otherwise

has zero empirical risk ( R ^ n ( f ) = 0 ). However, clearly this could be a very poor predictor of Y for a new input X .

Classification overfitting

Consider the classifier in [link] ; this demonstrates overfitting in classification. If the data were in fact generated from two Gaussian distributions centered in the upper left and lower right quadrants of the feature space domain, then the optimal estimator would be the linear estimator in [link] ; the overfitting would result in a higher probability of error for predicting classes of future observations.

Example of overfitting classifier. The classifier's decision boundary wiggles around in order to correctly label the training data, but the optimal Bayes classifier is a straight line.

Regression overfitting

Below is an m-file that simulates the polynomial fitting. Feel free to play around with it to get an idea of the overfitting problem.

% poly fitting % rob nowak  1/24/04clear close all  % generate and plot "true" functiont = (0:.001:1)'; f = exp(-5*(t-.3).^2)+.5*exp(-100*(t-.5).^2)+.5*exp(-100*(t-.75).^2);figure(1) plot(t,f)  % generate n training data & plot n = 10;sig = 0.1; % std of noise x = .97*rand(n,1)+.01;y = exp(-5*(x-.3).^2)+.5*exp(-100*(x-.5).^2)+.5*exp(-100*(x-.75).^2)+sig*randn(size(x)); figure(1)clf plot(t,f)hold on plot(x,y,'.')  % fit with polynomial of order k  (poly degree up to k-1)k=3; for i=1:k    V(:,i) = x.^(i-1); endp = inv(V'*V)*V'*y;  for i=1:k     Vt(:,i) = t.^(i-1);end yh = Vt*p;figure(1) clfplot(t,f) hold onplot(x,y,'.') plot(t,yh,'m') 
Example polynomial fitting problem. Blue curve is f * , magenta curve is the polynomial fit to the data (dots). (a) Fittinga polynomial of degree d = 0 : This is an example of underfitting (b) d = 2 (c) d = 4 (d) d = 6 : This is an example of overfitting. The empirical loss is zero, but clearly the estimatorwould not do a good job of predicting y when x is close to one.

Questions & Answers

differentiate between demand and supply giving examples
Lambiv Reply
differentiated between demand and supply using examples
Lambiv
what is labour ?
Lambiv
how will I do?
Venny Reply
how is the graph works?I don't fully understand
Rezat Reply
information
Eliyee
devaluation
Eliyee
t
WARKISA
hi guys good evening to all
Lambiv
multiple choice question
Aster Reply
appreciation
Eliyee
explain perfect market
Lindiwe Reply
In economics, a perfect market refers to a theoretical construct where all participants have perfect information, goods are homogenous, there are no barriers to entry or exit, and prices are determined solely by supply and demand. It's an idealized model used for analysis,
Ezea
What is ceteris paribus?
Shukri Reply
other things being equal
AI-Robot
When MP₁ becomes negative, TP start to decline. Extuples Suppose that the short-run production function of certain cut-flower firm is given by: Q=4KL-0.6K2 - 0.112 • Where is quantity of cut flower produced, I is labour input and K is fixed capital input (K-5). Determine the average product of lab
Kelo
Extuples Suppose that the short-run production function of certain cut-flower firm is given by: Q=4KL-0.6K2 - 0.112 • Where is quantity of cut flower produced, I is labour input and K is fixed capital input (K-5). Determine the average product of labour (APL) and marginal product of labour (MPL)
Kelo
yes,thank you
Shukri
Can I ask you other question?
Shukri
what is monopoly mean?
Habtamu Reply
What is different between quantity demand and demand?
Shukri Reply
Quantity demanded refers to the specific amount of a good or service that consumers are willing and able to purchase at a give price and within a specific time period. Demand, on the other hand, is a broader concept that encompasses the entire relationship between price and quantity demanded
Ezea
ok
Shukri
how do you save a country economic situation when it's falling apart
Lilia Reply
what is the difference between economic growth and development
Fiker Reply
Economic growth as an increase in the production and consumption of goods and services within an economy.but Economic development as a broader concept that encompasses not only economic growth but also social & human well being.
Shukri
production function means
Jabir
What do you think is more important to focus on when considering inequality ?
Abdisa Reply
any question about economics?
Awais Reply
sir...I just want to ask one question... Define the term contract curve? if you are free please help me to find this answer 🙏
Asui
it is a curve that we get after connecting the pareto optimal combinations of two consumers after their mutually beneficial trade offs
Awais
thank you so much 👍 sir
Asui
In economics, the contract curve refers to the set of points in an Edgeworth box diagram where both parties involved in a trade cannot be made better off without making one of them worse off. It represents the Pareto efficient allocations of goods between two individuals or entities, where neither p
Cornelius
In economics, the contract curve refers to the set of points in an Edgeworth box diagram where both parties involved in a trade cannot be made better off without making one of them worse off. It represents the Pareto efficient allocations of goods between two individuals or entities,
Cornelius
Suppose a consumer consuming two commodities X and Y has The following utility function u=X0.4 Y0.6. If the price of the X and Y are 2 and 3 respectively and income Constraint is birr 50. A,Calculate quantities of x and y which maximize utility. B,Calculate value of Lagrange multiplier. C,Calculate quantities of X and Y consumed with a given price. D,alculate optimum level of output .
Feyisa Reply
Answer
Feyisa
c
Jabir
the market for lemon has 10 potential consumers, each having an individual demand curve p=101-10Qi, where p is price in dollar's per cup and Qi is the number of cups demanded per week by the i th consumer.Find the market demand curve using algebra. Draw an individual demand curve and the market dema
Gsbwnw Reply
suppose the production function is given by ( L, K)=L¼K¾.assuming capital is fixed find APL and MPL. consider the following short run production function:Q=6L²-0.4L³ a) find the value of L that maximizes output b)find the value of L that maximizes marginal product
Abdureman
types of unemployment
Yomi Reply
What is the difference between perfect competition and monopolistic competition?
Mohammed
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Statistical learning theory. OpenStax CNX. Apr 10, 2009 Download for free at http://cnx.org/content/col10532/1.3
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Statistical learning theory' conversation and receive update notifications?

Ask