0% found this document useful (0 votes)
30 views44 pages

M4 ML Algorithms

Machine Learning Algorithms

Uploaded by

r8342254
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)
30 views44 pages

M4 ML Algorithms

Machine Learning Algorithms

Uploaded by

r8342254
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
You are on page 1/ 44

3 dasses of algsithns

1 Dota Engineerin Dota Mungen pepeakng, proco8ia|


we soing , Mapeduce Pregel
optnizatum Algo> polameter eSthimakin9, sBoc stic radicu|
descent, Neuuton Mehod, Least Squaes
3. Mathine leasning

Mahine Lecsnins AGo


or cluses.
used to potdick, classify Sueiugt
Senesaluz iong to congideled by Data
Broad b o s e d on mahine

. J n a p r efing pasamekag Leons Stetis-t on


Confidente witu vals

3 Role o ASsumphirf K-meame


k-NN,
uneon ReR033lon ,

Tree Basic AlaRithm

Line Regagson AHing model


3 Evalucehn Mekrec
A d d Moe assuphons
about eovos
Add DE poedicBoa
5 ToaMsfvr ming e paedictor% .

ruo
mekhod Fo expAARS
Macthemalicel elotionship bo
Bosic
vaiableg
outcome vasuable
ed uhen inea elatoShp b
vosuable g seveal othe ouables
0r behween one
paedCkor

n one vasiable cor>elate unesaly wlth chamges


hamags
Vahable
thea
.

an0 y o u make moR mOse.


ake Sold
mda ubrella
Ex 3h uh sbpe inkacep-|
sbpe 89 nkscep-|
deeanuushc ineg
uneg
n e a eRABioo
8
( x ) = Po+
sotial Newakmg sde
Subsphian
Revemue C
Ex

y-25 200

T No. ONeuo Ruewds


No. O5 MembbeAs
FHing the madel
be üke
ARUmun
ARUung men velotiom&hip
yPe + P Ma nototuon =
cbsenvoting dota (X,19,).
Begt choice for P o P u M
C,n)
,that mininizes distawe bl all points 8 Gnt
Caluutating P
Residual sum of saunaes, Rss() is sum O SAuases oF
dileces between poedioled :s%cbeeaved s .
RSs(B) = Z (yi -Px;

omae OueR al data Ponts

T o minimine R$s (p) = (y-Ar) (y-B)


diuenbiote w.r.t. omd set dt to O,,Sole hor P

O Addina m Modelin assumpmng


about i o s Jime yoo-
Spemt
- Copbuse vauabuti in model

y- Pot , + e
notse ETros tesm,differemce bf
2
E No. erievds.
obSeuahen ue reRion une
e N(o, * )
Londihonal diskibutior ob ven *

P CYlx) n NCPo+ B , )

Acual oro's e s

egtimad vosioMa () o e
T-2
meam SawaiQd eror
Evaluahon meics.

R-squaaed

Poopothn tvaaiamte o achual valun Captusd


Ou model
obseunq dala e obseau.
P -P-voaluug probabuty o
l e s ukely Fo obsem
Low p-valul indicode
PC)
-

Suth data n d s n u l hupothe3IS

hgh p-value
Cooss Validohon
3
tunina & 20, intext ,
dala into 80, Compae wnh
wh
diude
sek & cCompatl
t Ra model o n -wt trinn

Lest
Adding paRdickt
Mulipe tineas Reqekion

Po+ P,x+ Pxt t¬


e histogams
-

drauL s o l r Pots

ToamsloTmahm
taamshr ned as
polynot'al sip co be
reloliom
vasuöbi
neas by heating ne

medel basedon Z
buld u n e a i Respsim

AssunPhLmg

Leneasy distibiod uilth


wih mean
nean 0
leams nomaly
ETror
indepedad of eath oher
3 ErToY tesmg
yosuamte accOsS
Valus o
have Constam
Err O eam
Prtdickors e
5
k-NN bunch o
hat s ued to classiylabel
alooihm
objets label
similas oojetg o
J+ ugea alseady classyied
unknoun obeds.
Coedit
clossikg people as hugh Cedd, lo low CamA HSsk
podiet as hgb Camcs DSk
vosiable , b u
as Contnous
Lineas Regosion oulput
here label
m N w wamls Caleqdial
otha ilems deened
dettned
KNN onsilu most simuat
thas labels and ive
based bn attgibuleg ,
look at
nass n e d em).
may&uky voBe simlasy
Simuasby
deide

KNN considea hou to we


uwe conside
Mamy
neighbovs
houo

Exampe. J00

age cneome CoRdit


Income
69 3
51 low
6
9 ow
49
O
ow 66
20
58 26 iig ag
high
mw
w em
mee
kNN PDOCess distamce
simlaaly oy lest doala
8 test
& dala
I.Detide on
eladase
dalase
into toaining
taaunina
Labeled
omiaina Cisclassifi ahn
eahon eke)
ek)
R.splut
m e i c (iscla
Ssi fi evaluoto
e valuothuo
evaluahon heEk
3. Pick chongung
k,
few timee,
Run N ev o l u a h a me
m en
aßßuuss
ea

measL ev oluuaha
beg
beß
pickinig
. optimi2 e
k by egt s
Se w h nolabek
e w nolwbele
se
Cotate g
Same torunins
6 USe
Simuloaty or Disance mdaics
. Euui'dean DIstamco
. Cosine SimdasAuty
eal -valw ed vetos g Y
-

bl 2

Vallue o inidepend e t
1 exaaiy same
- exacty oppoSite

- Cos ( , Y ) =

3. Jacasd Disame
di'stance b sek oobjet
ines
E x emds A ={ EaM, Maik , Lura
B= Malda,Mogk, kal..
TCA,B) =JA0B
A UBI
4. Maha lanobi3 Dishamce
tuo vawed veCs
-disBamu b[w

d(,) =
NR-)T S' -U)
S Covagiance motrixk

5. Hammins Distane
O DNA SeaOMce
distauce bw t lngs
Same lemgth ouve iB A Ccuftee o)
cean &
duHence blu 3 (befRee)
hose
shoe &
check
cheik
Cah pokihim
thsough
o
6. Man hattan vect&e
k - dimensiDna
-dstaMe blw tuo eal -valned
Lte fashon
-Mamhatan cty ad -

ith element o
wheaei
y) z -y; ,

d C
=
eath Vetor.
acunung Teshng setg
Jn Toaining , Coele a nodo &toin t
Teshng phae, use new data to teg e Modol as if
mocol.
we dont Knoudhe
om cloanned data
The 20 Ok cta
selectad amdomuy

PiC Cm evolunluan melLe

Seusitiuty
Speufi
Preuston
- Recsl

AccuvenC
Mis classikicion (-Accunacy)

choosing have contol ovG.


that we
Poasmets
deffmt value3 of
-Run k-N fo uith
uth
amd Seled te
seled- he dne
dne
mellic
check evaluation

beter ModeliG F-NN.


AssuMp-tionc wuhe nothon of
Some e u a space
. Dota
aks Semsee
dstamce tuuo % Mde Class|
Labelted
Labelled uth
u it
nas beem
dla
.Toauinung

Pick he no. neighboas to nuse, *.


33. & labels
ase
SsomehoLO aso Cialos
soMekow associaleJ

dbseauusd. featuaeg
evaluotion mehic to
4. Assume evauobuorn methc to
check. ugig
add
add Mee telip
veuy eusstia:
& k -for leaing spam.
hy Lneasn Rogiesgion
isute about uinean ReagoogO) spam fHeaun
dotaset ag a malic ,whee eoch o d CoTCLPendg-to
3. Cenaide
a emoi. difleu

uolumn
3Ccaiu columns fur eath doydg, heee Viafa' a
the 0d Viagia, Bhon that
emad Contain
4 Ony
Alled uith value 1 elge assin o
Column
imes e oorld appeal
alkanalvey one ca put no. o
eMal whee
ineoa ReReO we need training
5. for vasiabde
email haue be be lab eled wth cutcome
i.e spam à Aot
be d fo dodtig
Rg cal
6. A humam gooe spam
tabe ling tak
e buil
Wmodo
T.neh Romeeon labals
to pedict-he
hout
lobel 9 gve
An emau
8 1 os spam)
C o f o y not spam,
TaslEA binvy
9 oudcome ig a numbeh amd

dn LineA Paspesiom
10
coninoMs evau aboue tt
valueg'
Pedcled
Cntesl
value, 3
Choose a
belous hen outpuut u 'o'
outpud 4 , Ua9uab lep
ou toD Many
beuause
uRk
12 J+ do noF ,00,aDO W6r de
wukh der O
l0,000 eMoulk in vests ble
te
MaaX n o t invegtsble
tna
trd
Camot be in
i ne
e aa
A s
TR
1 13. Thue but shil
shl
wuDds,
wuDdg,
uaut tha D. oUutttc
LeOm e
we could O MA

4. binasuy
appropale to
Pe Raos wot
hy k-NN dLD not uskus Spam Haing
wute abeu -NN
emoud
2 eMcuile aRe paegeuted as Malsu x., uuth Ou06or
i?
Owid colum ng
Malux eibue9 ale ether o r 1 depemdung on peence
3
hot wid
be neos, basld on
tud emo as ad <
L F o s k-NN,
4
con+aLn.
both
usdg thoy
Loo manu dmen Siong g
uul have
5. HeI 1,00, Do uode
which
dimevsional spoce
OD, oD0
-

m
Cornpuhna di Shance
Compuodh m wk
ase LDt
maka K-NN
dimeusionalilty&
ut
6 3 u M s Rom u e O
PooY olgRth m

D1gut Recognihon
eath in a 16x16 pixel grid
Rappee dmensiomal space
256
UnwsaP 16x1b qid into
veCctonize ap Py ENN tune
Acclay, Confutosn a

NaLive Bayes taud


tad
-classacahon
nethod bosed on bayes
ppudatian injedad
Rore dus Casp
uuhsL 17 o
Exanple
tes posdwe
Scck pattewlg
99 -cst negative
pabevdg ha
997 healty poobab-lib
posiuive,whot g he
test
potiemt
Pahea
G,iuOA
GIvOM olly sKck,
achuall sic
Ppulodton
0,000 ppl
99 haalhy tagt + 99 hehy
sick
asdeAuy+
0opp
9900pP
Hee SO%
9 egl+ 1les+ f997test
1leg 980 PP
Peson 11ppl
Let , y b e venug u t probablng px),p(y)
poobabliay wheu both hoppeu
POX,9) be join
one haPPRnsive nupths
whA
Londitional poobasduby
has Aoppend
PCx,u)
=
P(u|x) PCX
P(xl4) PCy)=

olwe kor P(u),agM Pa) fo


PCya)= PCxly) p)
PCx)
"Jam Sid o"sick
euen-
-Le y e{to
+
to ev egt u potdue
he
= Pt
|sick) p (sick)
P(Sick+)
PCH)
o 99 x 0.0
o.99x o.01)+o.olxo.
9a)

507

Naie
N a i e Baye
Jndiuidual wrdg ug
foY
Spam A t
emoid 8 Spam
awd, add& to poobab
O Cuss O
u0nd at a f m e
condla oly one

wdicaleg
non sPam
han
e ablity of S pa
SPa
PCSpam) pso b o n SRam
oebalbului of
PCha
PCham)
1- P(spam) emaul
owod
in
sF
PCwsdspam) po botsuly ham emanl
o nwdd
dd in
tn
probabluiy
P(wc|ham)
Apply Bayeg La P(SOYe spam PCspam)

PCspam |Wád) = PCNOd )


PCwod)=P(uusd spam) P(Spam)t PlwBd|ham) plham)
emoulg
NO- O spam
PCSpam) =
Tot No. o emaulg

Pham) No ok Non-spam emauls


Tbt No emad

with I500 SPams, 362 ham.


Exap EMployee emais

wRd oappeass 6 times in spamM


Meehng
Is3 hmag in ham

Pepam) =soo
ISbot 3672

l-o-29 = 0.4|
P Cham) = I- P (spam)
0 Olo6
PCMeehng |spam) 500
53 =0.0yl6
PCmeetins Iham) 3672

P Cspam lmeehing) =(meetins |spam) PCSpam)


PCmeebin4)
6-o106 O29
(-ol06)0.29+(o o4l6 x o1)

0.09

PEpam)+PCmeahng|ham) Phem)
Cmechin5)= POmeehna lspam)

You might also like