Docsity

Machine Learning Math Essentials, Slides of Artificial Intelligence

Partial preview of the text

Download Machine Learning Math Essentials and more Slides Artificial Intelligence in PDF only on Docsity!

Machine Learning

Math Essentials

Introduction to Machine Learning

Winter 2012

Areas of math essential to machine learning z^

Machine learning is part of both

statistics

and computer

science– Probability– Statistical inference– Validation– Estimates of error, confidence intervals Li

l^

b

z

Li

near algebra – Hugely useful for compact representation of linear

transformations on datatransformations on data

  • Dimensionality reduction techniques z

Optimization

theory

Introduction to Machine Learning

Winter 2012

p

y

Why worry about the math?

These intuitions will allow you to:

  • Choose the right algorithm(s) for the problem

Choose the right algorithm(s) for the problem

  • Make good choices on parameter settings,

validation strategies

g

  • Recognize over- or underfitting– Troubleshoot poor / ambiguous results

Troubleshoot poor / ambiguous results

  • Put appropriate bounds of confidence /

uncertainty on resultsuncertainty on results

  • Do a better job of coding algorithms or

incorporating them into more complex

Jeff Howbert

Introduction to Machine Learning

Winter 2012

p

g

p

analysis pipelines

Notation

z

a

A

set membership

:^

a

is

member

of set

A

z

B

cardinality

: number of items in set

B

z

B

cardinality

: number of items in set

B

z

v

norm

: length of vector

v

z

summation

z

summation

z

integral

th

t^

f^

l^

b

z

th

e set of

real

numbers

z

n^

real number space

of dimension

n

n = 2 : plane or 2-spacen = 3 : 3- (dimensional) spacen > 3 :

n

-space or

hyperspace

Introduction to Machine Learning

Winter 2012

p^

yp

p

The concept of probability

Intuition: z

In some process, several outcomes are possible.When the process is repeated a large number oftimes, each outcome occurs with a characteristic^ relative frequency

or

probability

If a particular

relative

frequency

, or

probability

. If a particular

outcome happens more often than anotheroutcome we say it is more probableoutcome, we say it is more probable.

Introduction to Machine Learning

Winter 2012

The concept of probability

Arises in two contexts: z

In actual repeated experiments.

  • Example: You record the color of 1000 cars driving

by. 57 of them are green. You

estimate

the

probability of a car being green as 57 / 1000 = 0 0057probability of a car being green as 57 / 1000 = 0.0057.

z

In idealized conceptions of a repeated process.

  • Example: You consider the behavior of an unbiased

Example: You consider the behavior of an unbiasedsix-sided die. The

expected

probability of rolling a 5 is

1 / 6 = 0.1667.

  • Example: You need a model for how people’s heights

are distributed. You choose a normal distribution(bell-shaped curve) to represent the

expected

relative

Introduction to Machine Learning

Winter 2012

(^

p

)^

p^

p

probabilities.

Axioms of probability

Non-negativity:

for any event

E

F p( E

for any event

E

F, p( E

2

All possible outcomes:

All possible outcomes:

p(

Additivity of disjoint events:

for all events

E

,^

E’

F

where

E

E’

p

(^

E

U

E’

p( E ) + p( E’ ) Introduction to Machine Learning

Winter 2012

Types of probability spaces

Define |

| = number of possible outcomes

z

Discrete space

|^

| is finite

Analysis involves

summations

  • Analysis involves

summations

C

ti

|^

| i

i fi it

z

C

ontinuous space

|^

| is infinite

  • Analysis involves

integrals

Introduction to Machine Learning

Winter 2012

Example of discrete probability space

Three consecutive flips of a coin

  • 8 possible outcomes:

O

= HHH, HHT, HTH, HTT,

p

,^

,^

,^

,

THH, THT, TTH, TTT

  • 2

8

= 256 possible events ‹

example:

E

= (

O

∈

{ HHT, HTH, THH } ), i.e. exactly two flips

are heads ‹

example:

E

= (

O

∈

{ THT, TTT } ), i.e. the first and third flips

are tails

  • If coin is fair, then probabilities of outcomes are equal

p

( HHH ) =

p

( HHT ) =

p

( HTH ) =

p

( HTT ) =

p

( HHH )

p

( HHT )

p ( HTH )

p ( HTT )

p

( THH ) =

p

( THT ) =

p

( TTH ) =

p

( TTT ) = 1 / 8

‹

example: probability of event

E

= ( exactly two heads ) is

( HHT ) +

( HTH ) +

( THH )

3 / 8

Introduction to Machine Learning

Winter 2012

p ( HHT ) +

p

( HTH ) +

p

( THH ) = 3 / 8

Example of continuous probability space^ Height of a randomly chosen American male

  • Infinite number of possible outcomes:

O

has some

Infinite number of possible outcomes:

O

has some

single value in range 2 feet to 8 feet

  • Infinite number of possible events

‹

example:

E

= (

O

|^

O

< 5.5 feet ), i.e. individual chosen is less

than 5.5 feet tall

  • Probabilities of outcomes are not equal and are

Probabilities of outcomes are not equal, and aredescribed by a continuous function,

p

(^

O

)

Jeff Howbert

Introduction to Machine Learning

Winter 2012

Probability distributions

z

Discrete:

probability mass function

(pmf)

example:

sum of twofair dice

z

Continuous:

probability density function

(pdf)

example:

waiting time betweeneruptions of Old Faithful

probability

Introduction to Machine Learning

Winter 2012

(minutes)

Random variables

z^

A random variable

X

is a function that associates a number

x

with

each outcome

O

of a process

C

t ti

X

(^ O

)^

j^

t^ X

-^

Common notation:

X

(^ O

) =

x

, or just

X

=

x

z^

Basically a way to redefine (usually simplify) a probability space to anew probability space–

X

must obey axioms of probability (over the possible values of

x

)

-^

X

can be discrete or continuous

z^

Example:

X

= number of heads in three flips of a coin

z^

Example:

X

= number of heads in three flips of a coin

-^

Possible values of

X

are 0, 1, 2, 3

-^

p (

X

= 0 ) =

p

(^ X

= 3 ) = 1 / 8

p (

X

= 1 ) =

p

(^ X

= 2 ) = 3 / 8

-^

Size of space (number of “outcomes”) reduced from 8 to 4

z^

Example:

X

= average height of five randomly chosen American men

-^

Size of space unchanged (

X^

can range from 2 feet to 8 feet) but

Introduction to Machine Learning

Winter 2012

Size of space unchanged (

X^

can range from 2 feet to 8 feet), but

pdf of

X

different than for single man

Example of multivariate distribution

joint probability:

p

(^ X

= minivan,

Y

= European ) = 0.

Introduction to Machine Learning

Winter 2012

Multivariate probability distributions

z

Marginal

probability

  • Probability distribution of a single variable in a– Probability distribution of a single variable in a

joint distribution

  • Example: two random variables

X

and

Y

Example: two random variables

X

and

Y

p

(^

X

x

b =

all values of Y

p

(^

X

x

,^

Y

b

z

Conditional

probability

z

Conditional

probability

  • Probability distribution of one variable

given

that another variable takes a certain valuethat

another variable takes a certain value

  • Example: two random variables

X

and

Y

p

(^

X

x |

Y

y

p

(^

X

x

Y

y

p

(^

Y

y

Introduction to Machine Learning

Winter 2012

p

(^

X

x

| Y

y

p

(^

X

x

, Y

y

p

(^

Y

y