0% found this document useful (0 votes)
152 views

ML Numericals

Machine learning important numericals

Uploaded by

Gon Frecs
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)
152 views

ML Numericals

Machine learning important numericals

Uploaded by

Gon Frecs
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/ 21

Naive Bayes NuMAicaCut butes (olor,les-

Etnmale mdiisnalrobn llues 6


dale Jve
the peas clas fMH} ung
egt,sumelly) {or
Tu Tasle he probability vauus pr
estintal
probasslties andunellyN)
uinr h e 2, Haight - Tale
neu insanc -
[tdloGr,
Specres
Color Heehs Sonaly
Shet Ves
shile No M
Tal M
shert
Yes
3 yreen Yes
Shnot
while No
Shett
Gree No
Tall
thile 2 No
2 Tall
7 shile Suert Yos
8
while 2

P): 0
Sol
Cote M H LegM
Whil 24 3/4 3 34
Gren 2 . 2 /4

Srelly M H
Heghe M H
3/4 2/y Yes
hme
Tale 4 2/4

P)x. PGtm): Petn). Pltm). PNA).


P(M/NewLnst 'SX Y, xl,x k, 00 78/125
PCet): P{Tha) P )
PH)X PC4iH)
PMIN.)
S x1 *Jy 4 9
0 06
Inslauce btlsngs ti clau tuMan.
New
UH-2
Baye 6plimal claalical exanple
Bayes be 5 ypo hnues hi thevugh
hc.
het thes be
Phi) PRIi )
PlAilD) PCFIni)

04 1
O
O2
1
01

01
0 2

Moveneut kobei 4 defiucd


F prwand

At
a ROB0T shoud pocerd
heory,
Now accocding tu AP
orroad clasificalusn
o Bayes ptimal
Accondig

Plue) Plilb)
uiEH

O Foruward Pha/p)+ PCFlh3): Ph3lb


PEI) Peulp)t PElu») 0 to
tPEhy) PhalD)tRhs2

Pha) PChib)
+PC/h3). PhalD
+
Lett P i) P1D)PbulD)t Rhsdp) HUAT)
PElhe) t IX 1
= O.S

X 2+ Lx1

Lo, accondiug ot o Bajes 6ptuuua procedure Kobot uiin keft.


o, accondig
Unit-2
Bayeian Neliwork
iudepenence acunptiou liat
allows Coudltt'nal

aPpto subcet
the vauables.
avee
Lh prebabilty.
disbibulion
BBN desciibes
set vaiatdeg
cLhere
Coneide asbial R-v. YaL > --Jo).
volue Veyt)
e a c h ye c a n take

Jh riut space R.V Y u CLoss poduel


Vey)x Vg) V
disluibielio ave thia goin spqce
ApbabiUhz
pobabiliy du ihulesm
oiu
COALRALeiRepreseutaliem
oishbrulum ovet
mebabilib
t represeilts ount
Set a vauale

Aire chlaeplle Graph DA4)


Tabte CCeT
CtPTD
Coudiluna! pmb abi'b
Ceach v a eable

(S Is579 (Buslsupk- Nodes. Nin N/w in nod)


nod)

lenu Camp) C4 8 2

67 2
(Thunder
orestfire

vatiake s cmdituonally ludependeut


repsrzet tho NYo ven i u
asc
non desceudeut h
innediali prccecesuor
Jhe doiut probakilihy r any
dleved asignment value

f)canv be campulad as

P y-t)= P#/PaxuCY))
fnmedialtapreckcener :
Paseut tya) assoeiald
valuer slied
in epr g
P$lpauuti) è
noode

Condulioiual Indepeudence Diocrelb


Let X Y z a thme R: V
condiamally iudepeuudeud Yiven
We sy X
2

PCly) P)

ChanRule
PB/A) PA) P):PE)
PCAn)
PCAMA As) PAs/AyP)PCA A)
Exanple on Bayesan NjW

(G
each vaiiable can have boolean alue
PCCIA) :81P(/A,A)=O'7
PCA) 0 3
Gven
PCC/A) 0 PCAAB) 0-8 -
P CB)0.6
PCD/A8)-01 P(DIA, B):02
:02
PEe)= 0* PLEJE)

CPT A BPOD PID) Chaiw Rulo


AB 3 PCA 8) Pe/A) PA
PCABnc) P{G/AB) P(He)
A B
A B 8 PClA) P(1B)P).
2 8 P CAn-04) n PCA I Aj)
OCaleuate PD)
B)+ PCD, B) t PCD, 8)
PD)= PlD, A, 8) PCD, A, t
PCA, E) + PCDIAs) +PAB)
PLDIA.B)+ PCA,8)+ P(OIAB)
tPCbIAB) PCA B)
PlDIA,8)+ RA) PB)+ PbIA E) PCA) PB) +
P pIA E) PT) PB t PCDIA B) PÊ) PA).
7 X3X 6 t 8 X 3X4+ 2X 734t '1X 7X%.
32
PCD.c). = P c A B) tH0Cc b)t PCSCA B)+KcA B)

PCE/AR) PCC)AB)
PCb/D) P CclA) PA) PE)+ POIsa) PEIs) PË) PO)
+PEh E) P Eh) P n6)t P(5/gE) PEJA) PENE
3X 8 3X 6.t 9 X 4x 7 X 6.+ 23 8x*3x 4
t 8 X4X 7X-4 3032

Given Bayetian Nekóouk

(Rain Sprink)9
PD 2

8
P/as
wetass PW/RE)
P RS-
Calculale P(s/iR)
PR)

Sof
PsR). PR) PE)
PWS R.
SR)= P/NR): PwR
Pw P(ws
PNSR + PCWSR).
Ps/wR) P(NR)
PLebO . pror Lnt3
qtven data calcuulale Kecall, Peciubn d accuuasi
Pred butput for úrerhotd o06
0S
0'9
1
0'4 1
1
0'3
0'4 O
1 0'S

Cbupuion malu Rclaal


Ottve) L-re)

O
TP (2) FP

FNL1 TN 2

Recall TP
TPtFN

Preousn TP h1
TP+FP

TP+ TN
Accuay
TPt PPt FNtTN

Cunti tiviky TP
TPtFN
TN 2
pe TN+FP 2
Numerical on Fiad Cs) algori%m

gor a
gfvuw dalacet {iud a maximall se oite
ypothese
1edihenby
S No talion cize inlibrary priee
SKme Smalb
ordab Ma
eapenLuwe be
2 b
man
aluotyp en pensivee
Seme
meduum expesive man
mauy
mall pfordatma
5 hMan

Soulin.
Wep1 Cas emuple
extuple 1)
1),
b u c e ignore
las
Negalwe exaupla No
Sep 2 ho aordable mang
Small
X1(So me
n1 ho

Mep3 ne)-Yes
ne)-Ys
o enpenswe
X mauy
(ai
expentwe ). -
e) Compariu

b4 wo
ha (many X).

nlgature erauple-igusreit:
lp.X3 agan
hg e h

mesdtium. no epntie a) -Yes


enpentre mauny)Yes
yCmany
sS no enpeneive ?)
hyman?
Sa Xc m a n small no akoredakte maug)-Ys:,

hg Cman? no ??)

So final kypothei &


hs(many ? m ? ?

A
Numesical on landttalo Ceulnaun algoathn

Clas
Sixe Coler 1 shape
cude No
Small Red Tuanyle No
Cmall Al Cucle
Blue Cicle No
Small Bue Yee

Tnd nani'mally speclkt'e aud uauiuall genena gpother


nmosttgenete bounda
bruudas
Slaat wih most speciffe
Go C? ? ?)
So=(¢)
-Ve°'o slat specikte botundany.
e Rample L G Cmall ) ,
C? Blue ?),
C? ? kiage).
CGs oblan by conpautuy
Red cele)
Sa Smale o exauple and found
olukenent closazfcalin o
S(Cmall kad ciole) Coupui Conus tent hupo thaus
Yme
ey Hakihy each ? ata" value
SSmall ? cicu)
eplaciy lt c pposita
altibul or ieutenaupder)_
ConsislenCy can be Conpuled by
Cnpeuiny Ho heo E exampli 4
Cheikiy eack elaajcaln. {
malhio t onusln&otKe
stoe nBt
(Small Blue ?) cice) C? Blue ?).
(Smatt ?

(Bg ? aiangte) (? Blue Liang)


Conypule all He
alo -ve
CBecaute 2nd example u
aud Heu eheck or lmeultu
tuypotrones
buuudy
geunen'e buua
enen'c
tve Co We alat
Nenl eoranple is

most comei l i i
13 (small ? ciucte).
(snall ? cicle)
45 Cmall? ciule)
()

A
nit #3
en fllorsing
11. Fenlormm KNN -classiicalsn alyor+thm
Feorm Akuma
tne ehs orX CA 3
dalá set and preditt
K3
P Class Eulidan dülauce
False J(y X)+%-Y)*
7
4faluee Dy -13H{7-T*- 4
Trte 5
3 DaJg-)°+(4-7) =J644
True Da J3-3)H7-4 3.

36
4+9
DyJ(3- 4 (7-4)
P Dulance
P fal
7
1 5
True

36 Tae

pr class talse T) + St T
SCFF)+ S (F
(M)-
1

for class T SCTFt S 1)+ AI7

2.
bday
frTnue > false (? 3 audPs 7)
nslaice
. given
So the
th

ctasTorue
ANN CUntt)
AUm lhl neuu have a tignoia a i valon kunelrd
and a btekwad pas o Une nehuvrh.
Pecrn prward
a pa
and leasni
hal The
acual dulput a y 0.s
sume
sume
Acule i 1
5 3

w3I 0 ' 1 Wg3 0 3


X35 H)

w3o8 Wg4. Ns4 0:9.

X-03w4A0 4 5
Sdulion
Forward Pa£s nebs.
Ksa O3
5y y .
neb

t 2 wyr
neky
rl*'W41
Ng4 O

35X 4t 9%6 =
0 68
Mety
O 6637
+e
:Jx8 0 7SS
9et3 35X1 t
0'b802
Os 7 t e ©7 5 5

O80139.
6802x3t 6637X 9.=
nets
0595 14eoPO13G 69 027 iual op
Ed tauget Outut
O:s- 0 69027
-019027

Nelghl aupdalion
Auje - j

a nan opanit
S -(tj-9)jl-oj)
4 j u a hdden tuit
Kedownrani)

Back nad pass


0'6g027) x 0.69027 (1-0 6902 7)
S5CoS
-

-0-00679.

Oy C1-Oy) Ss Wsy.
S 679) X0-9.
0 6 6 3 7 X(I-0.6637)(-0:040

-0.008/716
- 0 0062

S3.= OsCI-03) W53


85
6 0 0 2 ( / - 0 6962) (-0
0yo679) 0:3
-0.0026546.

6802
-0 040679X
Aws3 18s Os
- 0 0276 6

-0040619 X 6 6 3 7
Dw5y 65 0y
-0.02699.

Ws 6301 S
- 0 0026546 X35
000g2911
Updale d Ve all wughls
e/oi updaled wji
J 0 090T
-00026s96 0135
3 01
0 7976
2 3 O8 - 0002646 09
0 39 71
0 0082 0 35
0 -

326

0 008 0 9.
0 272
5 0.3 -0 040677 6802
3 o 8131
5 09.-004067J 0663 7

Outpeut alli iut ilesahoi o weugrt pdälun

35 09907 t 09X 7976


net
9net
0 0 7S27
O6797
0s 1 t e o 1 s D 7

35X-397) t9 SI26 0 6723


=

ety
-0-6723 0 6620
Oy
7631.
F6620X 8731
heDs. 0.6797X 2724
0 6820o
Os s t
07631
e0:7631

Es 0.S-0.6820

-0:182
CNN (Unt-

ConvoluNm Veaheas Edge


fMH

2. o 2
loo
3X3
loo Batk yxy
6X6
+XD +OX2
+6X0 +OX + 6x|f+bx0+ OX(-)20
Ixo + OXo
6XD t()XIE - 4
Swt +bXu +
xCI)-IXo +
IXO +0xo+G1x1) +2xo
O255 ColoA Imase
-2-3J
R o2S
H Scala

6x6x3
lw oo 4255.
tw 4265.
Convut L pinl v a l u L
Min MaM S ingukmaAM
Ex*n
layus wtuh
ind Vahu
Human Kha'n ban many On Layn dves
AL Colye othu loyus
loys
.

u t h 4 oH
as
T r layus
au Ed
o
dldelhn4
izondae
imay oHwL dvu
esd da htn,
dakLhd dau n
do diphuuw
dcalas
nin max

olp u shit past is


dattmuny h a
o o2 t
blw imya
Vun'l edgt phiut
2Ss o 2T
H m 2 0 u a l

Dk

CNN nLmu app


C NN LucLd th dswl6 im t uAdy b apy

CN N
5 Stp a
Feahuu Deetth.
n L FLH|
2Stide

3. Pasduna
. Pralt
S.Fltten

kean

12/207
112
322 3 22
20 o22 2
3X3 3X3
2
5X5
T 5-3+l =3 sta °P
SShide.

N-+
S 1217
S ric= 2

Pads 942e N-k +2P+


SY5
S y5
5 - 3 +2x| +| =

6 17 3
11 12 /2
&|1O 17 193
OL

5|1.25AvA
A 2x 2
-forsn 9-54.0 Pby
Avt
Jnainego% CNN Cuwt-4)

Inpt Imaa
Poddi

ConvouAGn
win tho elp omulhpl An
ath'vahn fn. M e n L H PLaL mP
+RelU

Convet 2 D akay no D
Fatnny , to

N cbnnoutd n/w
vo d e n etwok or Fully
Appli

P Veuoh
CUAupnoliny ahul mP

1 nihialize ale weuts wh handbvm valus


. Faauward paghe (ilp->CoConvoluhdn RuU> Pforg- Ftatumy)
oIp
Phchablh tok auh
Clas
5. Calult kotal ennoh
sh t-0)
SsE>Sumo% guaad BaclepAupog
aNen
A is ag Hn appluy
dvmnt)
Back PAupagakien (wi gadiend

5. RepLa hil unmm UDa RapLatfA all i/p imags


n nit-4)
RelU CReUel Zinea Unit Ackvaton funtin)(nal kesikrd)
RaLU I apputd eU cOlusinal qperahen
i n o nsuhal
wawh
u poe a ReLU is Jiwavdua M (o
C o nr
uudtc
wbin
t
conveiunbn . '
Ab inui i addiel atenhave n m-bnuauhu.
nbM-bnauhis

imay mary
muny

itn funthtn bus


a
Nulhpu tojt pruud
Hun, imny
thn
e vot bwal &th im nu o baLak
So un i o
Image
I'mas
in a bne Aoeh
Relu
migt Alf behs
b e h sve
e ke
ske
awty i h hu hun
CAN wt
CNN w
hod
adsl nan Unauy
d H* adtr
or
Je
nt pesfo inn
d o
donB
n t

Rudshen.
you w
w l
I
clhes,
Tt
Tt
Untai
a

RelU funtm

ACmau'n
vatls
Ve
supkUnecl 4
V a u S AL
-ve

h aA mnd4 tan
tan
unhw
cthe nn linnar bte
wLe but ReLU pufaims -27
Can alsu bL tonh) -e

+
nsupemel JeasuyAlso SoM Numaulcse (unit-4)
Cowtutt sofM to c m t oun ginn vechsu
Coo113,CIoo0, CoIl oJ o o 01.No o
C b b a h m u a 2. Amumu Au Iwtol Loauun

tode oß o.5
Sol no ishal ve tuh 4=
uwh , m 2

u2.

i i h a i u nunis
O 2 97
O 7
5
o

fit P veud X= [o o113


DCS
2
Duz Cwi-Xt,)

- + (r)+ (
( - ) Cwa )
(0-2-0)+ (o4-0+ (o6-1)+(o2-0 =o4

2
+ ( )+ (-Xj +(
o1-o+ (o7-o)+ C05-0 +(o-3-1)=2.04
wiu): wij(st + X -

Nj; (td)

+ 0 5 o - o.2) = o: |
02

Cnevs) ) + 0 o 5 CXa- w (otsl))


o 0 5 (o- o:u) =
02

w3a O 0 64-0 5 (1-0 6) 08 :

unw) =
O 8 + 0 5 Cl - 0 8 ) 0. 9

o 2

o 3

You might also like