0% found this document useful (0 votes)
1 views27 pages

ML Assignments

The document discusses various machine learning techniques, including AdaBoost and Random Forest, highlighting their roles in improving classification performance through ensemble methods. It also covers concepts such as gradient descent, overfitting, hyperparameter tuning, and feature engineering, emphasizing their importance in optimizing model accuracy. Applications in game playing, robotics, and autonomous driving are mentioned, along with the significance of balancing bias and variance in model training.
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)
1 views27 pages

ML Assignments

The document discusses various machine learning techniques, including AdaBoost and Random Forest, highlighting their roles in improving classification performance through ensemble methods. It also covers concepts such as gradient descent, overfitting, hyperparameter tuning, and feature engineering, emphasizing their importance in optimizing model accuracy. Applications in game playing, robotics, and autonomous driving are mentioned, along with the significance of balancing bias and variance in model training.
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/ 27

-Houw do Mehd.

chasihaton
mehedlain
0 Cplore lhe Concepl
sf entemlle

Adaboost tmpsove classi fcalion


perbrmance?
fovest anel
tke Random
mallple melhods
Conbine
nemtle melhod in yacline learain
A dhustness.Randon foesl
to inepsove clanifutom acen
and adaßoost ae pepudaa esemble techniques

tvee trained on Yamdon


Kamdom torest: Uses mmtiple decision
y vedueig
Cabses dola amd featnes. tts improves clositfeaRon

Predic kons from diverse models, enhaning


psiting amd awenaqeng

and

d AdaBaost:seguentialy traàns uoak djuotig eiht


leavners,

tt fouses move
for miscas sifed insmces in each Aound•
Cases
t
to vecluces msoA amd boost oveval
dhalugig
Model perornenee

Bot mekaoda enhanee clasifcakon by hotunging the svength

nulipk modek, terly ackeiing beter accasey and genenligaton


han indiwidual modelsi

Suitasle
shere

agen deans fime.


cumlahve Tewards over
Yeuahd oy pnalkes to mamimige

Appkeakon:

lake chess and Go.


Game plaging: 4r in games
or
Roboties : Robot, Aeavning task (eg oalg sbicct maniplaion

• Autamonads Driving: optimal driving behawiors


Vekcedes leoming

syetem;Adaptive. Content suggesko based on ucer


Kecommendakon

behavio

Reinforeement teavwiny (RL)


(RL)io tdeaf
in tdeal for
for taske
task reqiiag sequenhal
deision - makig amd adapfing to dynanse enviro mm ent

Hhe proceduse & feotuse scaling Contibuwte to he


(3) Deselbe

convevqonce and terformanee f optinigak'on algoithmg in Macki

Featuse
stondaraiye nomalies data to a imitar
oich acelesate Hhe convevqunce of ophimizk on al onithms m
in

descent
agenitys ke
pesformonce more efruiently, it peveat
ah large volauen feon
dominahing ohert, leading
a9
featnes

Bmocher md faster path to to a


he opieal
csluion,This impoves
both model

baned
algorithms ( erample, SVM, K- NN)
Describe the qndient destent optimiyai on algonkhm

modele, amd uhak vle


. How ia it
do
wed
rafes
macbine davning
tinig
play in the proess ??

Gadient deseen n an ophimiyhon algorith m Hhal- miwie aa madel :


hy iterahucy adijting pavamekers. 1t caladake: the gadienl

(Alope ) s, the loss funchon and updates pavameters m the Oproite


direchon to vedue or.
m
Gradienl- descent adjush model woighh to minimice
In tvaining:
loss,

Lzavnang Rate : contda the step: &ie for each update. 4 high ate

Speds up ver shoot the miimn. a lout ate


training
Provdes preuision but sou's conwerqence. Proper tuniag in Crueial

in pasbaktily waed in machine leaming ? Provido xamgles

Hhe
ere a paaiabikty ske jerpechve a benefeial in

Ktuakion

data
anayis

helps osdel un cevtainty make


Prediakons, ad interpel auuh. ey as saing the Ekelihosd

Aferent outomts, it nlances decision - rmakig nder uncerkinty


Examples:

ee
tb clas labels . ding in interprepble pyeik ons
Descr

helkes an emad s am rovi

Detechon: kelps evaluate


Spam
based on ovd fragueatiea
Fe

Re comngendakon Systemy; fsthalalikes


Posbabilihes
ye ict ws
wses
byefeven ces baned cn

behawioy,peronalizing Aeco mnendalions


Past

Bayesian Jnfeaence : Sntorporakes prior knosledge to

and
pdate

sein
madel

forcemenl
in sequenhab dcision - making
beliefe, wseful

karning
valu able whern deta is

A prsfaliuBKe þerpe efve is farieularhy

or ahen madeling scal-cod unceslainties


noisy

tradeoff the Context machine

,
bias. Vaviamce in
Define Hhe

-How does it npoact matel peformanc and ohat shategien


leaning
lan be

The bias -aviomce trade off in machine leanáng se|evg to

two sowsces BAOY Hhat hmpact model þexformance:

Bias : Emor dlue to oversinlfted mtela, leadiug to undofing

-Vdrince : Emov from overby Complex mdel, causing overftg


igk Jias sestick Jeaning,, ukile bigh variamc makes he model
Jencitive to noise

Stvategies to balamce ;

. Use. ensemlle melhoch (eiample, Random oyest )


*Requlagiton techniquu o Simplify complex model::
ndlyuat mpdel camplkzity (oample; tunáng hypenpanamees
Achieving the righF halance improves genera iah'on
aOWsacy f o
Macbine learning
m
tamee o feahne engineaing inpad
Describe
he inupor amd hein
tnginerig techniquei
fravide examgles of feakuae

perfor manc
e
on madel
learning as it transforms
o cruoial n machine
Feakme
and
model aceusacy
had daka into meaningtul inpus, onhan cing

effechveness

:
.Examples

sealing amd Normaligakon: Stamdardye feakue hanqes, improviug

algonilim Comvevganie.

•Encading ariables : onvext caeqories tnlo numerical formak

:
Categovieal
qorical
to'interpret them.
algorithms
encodig ), alloaig
(ecample oNe -hot
Interackon feakuses : Combines featues (eple : alipyi g

and iucoMe )to Cape


e) Captuae
selakonships

he or
ghh ke week
day
: Extracks insi

Date/ Time

uon
season
Feahse Exhracton

from dotes, ssichin data . leomnin. Leacig


to bettey

inpsoves model
e tfeckve feaue engncening

Fedlickos and qeanayaken


occws, and

8 Define overfting,

shat
and

measwes Cam be
uwderktig
taken t
Hou do thee phome
mitigae hem ?
na

data too

Overkting

in tluding
oceAs

moise,
snen aa made!

leading to foov qentialyakon


eoone the traming

new dola
on nous .
to Cfure
ftng:happens' shen a imodel' b too Simple, falig
Vrder
and test erors
data þoterns, Aeutling in
im high trining
10 Dis
Pou

Canse
þer
model, exesswe
Overfiting
: Complex

:
featues
tme,inodeqnate
tvaining
• Caderfithing Simpk modele, inuffcient
feaunes.

Mtiakion

boesfaing: Use Aeqularigalon (exomgle:L2 ), Simplity the madal,

more data.

Uhderfting: încrease
îne meodel Complealty, tune yerparamelers,
better featuves
or engineer

f Cross -vali dafon n machine Neasning.


(9) explain the concep
mod evaluaho
conti bue to
lny it essential, ad hon does it

a dea rnáng veve


- validahon technique în machine
Cross b

data u split into wdiple ubsek ( folels) to taán and test

perfomance
a madel ierativdly,proiding a more &eliable

estimate:

the modl
Importaue; It þrevent overf tivg by enauving

oforme ll on dtferent data splits. not Jwst the training et.

Contibution to bvauahon: Coss -Yakdahon offers a more acewsate

assessment of madel
gene valgahon,helpng Aelect madeb amd
hypeparameters that koak well on unseen datu.
machine learning models
he ole of yperparaefevs in
Disuss
to optiníziwg mocel
mor
tunning contibule
Pbw des hyrerparameler
erfovmame ? rnglel
for mackine leaning
rternal setbing
Hype paa Melers are
hat contrd Hhe train
number Arees)
xamgle: leav ningy vaie,

roes

Rele: They influcnee model complity,training sped,am


omd

Ovevall pevfovmance -

luning- Lonhibukon : Hypevpavameor tuming opti mjes these setings


the mocel to
amd qenesagohon, nalsin
to improve acewmaey

tt data wel aithoud Over Rting. oy underfting Technigues

help find the best hyper


vandon seovch
ike qsid fearch and

paramefer Values he pexfornance


Asigmmont. 2
aith a dala sel s ínputr
clasnifoion pslem
Cmides a 2 class

f3,-(-4,-),
, = (-1,+),Ms- (+i,
shattered
dy svM
+1)4
clansif'er
with Hhe

Can Hio daasel- be

Kernels 2 all
seperate
Cam perfectly
Meam that the clasike
Shatering
the focal þoink.
for
Label assiqmment
posibk

=
input poinh
Dalaset confains fous

y= (-1, -1), , t),,-


((1,

labelings of
(4,-),

the daasete.
(it,+1)
(a1,

a': 16 possible

a) Linear Kernel

svm bies to find a straig ne (Hyper lane)


Linear Kernel
imhe featue space.
that sepanate

lIhe fous given


the poinh

poinls ane asanged in


a .
squane Since
a

straigat
ineas classi fer can ondy sepanat poinh uing
labellings
he daasek Can be
o
not all 16 possile ine.
lines

npuaked hy a sing straigtt


okckdy

b)

the clat into


a
kemal 4 deguee traaforna
tolymaminal
Gpacs bay ineludking quadhakfe sytens .
gher dimenlonal
For a too- diuenáonal impul (, 4) the seconel degee

Palynonúal enpamsion ineludes tem like x,x and

: toamferiny inpul- polnts


Gauaian Kemel
C)

Allewh fleible decinion boundasies y mopping daa tnto

infinite dimensions.

Can sepeoate any possiole Labelling f the fou point Gpusen

kemel Can shatter he shaleythe dafa sel.

Conicer the training dakase gioen in the fdlosig tatle . ue

K-AN and detevmine the clays. Tesh iwstamce (7.6 Eo. t)

S.NO |Assesment boject Submited Reult


9.2. 8S 8 Pass
2 80 Pass
8.s 81
Pass

4
fail
65 So
fail
8•2 Pass

7 38 fail

9 fas

Test instnee (7e b, G0, &) and k=3

Jt6-s t (60- 8o)* t (e-) 2.0.028

091

t G60-4s) + (8-s) = Is-38


t (6o- so )'+ (t
de l(76- 6-s)

(8-s) = 22.2
t C6o- 38) +

31- 04

mstanees (6,80, 7) (ss, 81, &) and (s-8,38,5) are most


nea to each Oer
(8,B0,7 Pag)
(8s,81, 8 Pas)
(ss, 38, s fail)

:. The paedited clas .3for the

is
tesl

pas
istanee (t6,6o, B) walng
weighted k-NN aith K=
K:

borvowwer
contaiig inormakon abou- Joan
Cowider a dalasek
he her 's cuitable for appeovel
Rabelo indi cabing
ond Corveapondg
koan (Yes or No)
Maital Credit APruoved
ncome
Stahus -Loon

S0000 Maried Yes

80000
20 Ye
Single
600 No
30 30000
Single
680 yes
Maied
Maried 00
SBo NO
28 35 DO
Maried yes
620 NO
23 siagle yes
48 10000 marned
SS000 670 yes
38 single
*-ly.()- ly: ()
-0.t (-0454) o.3 *(-0.s2 2)

Cala.ulahig infovmalion qain for cach altibule .


)0at masial stahs:

Value ( ma ial Stabus ) : Sigle antial

s(Mafial status (2)


= 0.2 922

koetghed enhophy for martial statw in

:.s Mavbal status )


-(o.2922)+ 40 »0
4-0

-0.146|
Inform afon gcán for
mavtial stutw

.maried
snhsy (s
)
)
=0.26440|461
0l|83
2) Credit

Values cvedil
ccore ) = > 680 < G80

tcove > Gso)


lag, ():o
(ered't

s (orakt seore
0)
<<tto) -2 ly. ()- by. (1)
0.2922
coedit scove
entaphy for
weikted

s (oedtt sevre)
otEx (o-2922))

Informaton qain
for Credht
for cved't Score :
|sv]
- Entahay (9)-s
Ve (>b80<b3)

0-l|83
e Can
infomahon in bame tor Boh atbute
Since
oot mode -
choose Eher ot the attibute as the

Decision tre e o as foilos

Credit score

Credit Score

mar ial Stahus


Yes

Yes No
cmcl Hhe per Sn
6f Covariance
stalis keal
A Determine

Coefficiont for
the

the dafaseh
measnse

X= ,2,3, 4,S } amd Y : 4, 3, 16,26?

oikin dhe Conlext machine leannit.


X

2
-
SS =31
25

Covaiaee
()(:-5)
(1-3) x (3-1) + (2-) (4-)+(3-3) (9-)
L + (4-3) (16- i) +(s-)x(25-1)|

Cov(X,y) : 12

ferson Covelaion Co-effienl

T= Cov (%y)
D
shee
x md y ase stendard dreckon f x amd Y

(-).(-j+(2-a
t(s-)2
t(1-)4(+

1-41

-(2-1'tt(4-1t (3-1) +h6-1) (25-)


100 + 49+ + 2S + 196
4
314

12 0.983

co.effied- io
o.98 3
Frson Covehfio
bias
and herend- tvade - dfs lsekoen
the distineiong
Anayg factors infuonee he performance
Bhe koo
Diseuss hous
oises
and variae. madele ,and eueidate
machine
machine learing md selehan.
amd generaliaion edel wauahan
wthin he con bewt
heis asfe

assumpfon tn kae
to sOSS due to ovuly siplske
1. Bias sefess

mode! Leading to mderfty


patterns im dhe dala Reducing aeuaey on
Hgh siam Models miss

Ceh trainiag amd teut sete.

to tduettortin
indieaes models sensiHuty
Z. Varianee noi se,
high aiamee modes oven capfuig
traiig daa to
data But popr perlormanee

unseen dafa.
hite high vamance Cawes
Model complezity
1:Reduaiug Bia inals law Bias amd law
Model Hawe
Best
on new
PObs þevformamee

variamee for good


Bias
Bias -Vaianee toad
S.
Evalrahing models ases hing
seguire asseshiug
a mod el
eehaslayyis
eke crcs alctahion heep chooguy
2
well with overfMling amd underflling -
gunesaliyes

6 Consider a Random foresl- reqsession madel aitth so trees, each


a daasel- cofaiving 3ooo Samplee amd so
feafunes.
tained on a

mamium nubes feahues Considered


Busing traiing, the
at each spit n sel- to 7. Calulate the tofal numbes nodes

in he entive Random foret

o Caldate Hue sal umber nodes im the Random foyedt e

need Some asumptiong or typical chavactenites f how many


nodes each tree
migk have, ao this
mformali on
ghuen in the psbien , isn

Since the numbes o. nodes in each tree


trees
dlepends en how the
plit, hish in tsn depend on tho
ef he daacel, Compleity and sfuchae
e'll apsoxinate wing a comman
tyees.

Asumpton
amd caluwaion
Steps ::
lypical Depth
a Rmdom forest Tree:
Kanco forest tvees ase
tunkl they Aesch he mayimurm
deph uhese
doesn't hneaue fukhey srfns
psecdichve pouses
fo the depth d 4 a tree in
Randow foves naith n
Tree of Depth
d:
a FulI
Nades n Full Binarg
of depth d n:
2 Number
m a full tree wit
sf nodes
N
number
he tofal
N= -1

N: 2-1
21= &191

Foves
in Hhe Ramdom toee
Namben
of Nodes nodes acssall
3. Total gal number
the
we have
Since
= 4 09,5SO
Total nodes
= ox 8191

ith
Aruser: Random fovest
Final
nades m the
tstad numbe
the simafed
Thus,
each ith apporinakhy
So trees,
409,55o

voithia
feakueinporfand
fo deevmining
the mekhod
Iluatale the
in idofying
ik igmifeamte
lineas Reqesion,
elucidating
feakaes in m Hhe adel

strength
ifididual
predichve

as featuse [mpovtamee. to each


Coefficien

s. In lineaa
Aeqsesion

feahue Aepaesenting
,the model
tk mportanlee
assigas

on,he
. a
A larqe
coefficient

gredichd
absute vaue
ouleome -
inflence
indicate
a stange
duide f the Relakonsip
hous the
2 8 the co.eficdent chows Hhe
|he sizh
(Posiive o Neqatve )
stale if magnitude
he leught ariable
the inupact
3. To Compare feahuse inapor tance shen feature have difevenk

Unik, feakwe should be shandaed (aaled) to enswe thal

Hhe Coeffient hefleet tue Relalive inypolance

4
Sanifcand feahae aith lnqe cocfffeienk ase criical for

Predkchons, kle bmallen coeffcant may cuqgest less predichve

Reduadang

(8) Inveaigole ihe training prose of a Naie bayes chißey

on he applieaion mayaiwm iehood estmahon to

delernine the prabhalaiy iibukon 4 feakuos givch clos labd,


Qnd elucddole is voe in madel pavametey efimabon .
Uses maimum iketihood esimahon
Compute
(MLE)to
he pedsabithy s enah featueew qlen ahe
P|y) class tabel

a. The msdel
assames Conditional
independauce
anplafyig the Qumong feahne
Comutahon of joint
probaliities as a
a froduet

3. MLE esinake the


pavamefers bu nariniping the kkeli hood
funckon, 5
countg 0ceWanceA eaue values in Hhe
cata.
ven elay labels.

4
Usg MLE, Naive Bayes caleulates :The Aequived probalikHes
the
mgi ofo preceko

unug chsifeakon
he
model Y - 2*+1 amd
for he sinple intay seqsession
A
Absslute Error (MAE),
Mean
the Mean
caleulate
sing dahset,
follo
ean sqpaed
Eror(Rmct)
and Root gean
(McE),
Squased Ervor

Regaesson Model
Y- 21+ !
Sinuple leavn 3
Mean Abs6lue EvroY = 2

bshere Y = Pre diched value o Y

velue of
Y Mean
eYYOY (Y:-y)
Mean sequred

Koot Mean squared eYYOY MGE


^,2

a aith so Samples (30 of clas


(0)
4
4decision tree

anel 20
cpts

class B) into to
node

child nodes .
The deft child

the Right
has

4 and 5 dase) amd


(1s f class
O Samples
A and 1s clas 8) .Compute
(1s of class
chitd has 30 Sample 15
infomakon gain fro m his slit.
Ahe

here
ft Hhe Proportion s amples in elas i omd e s the
number classes

for paven t Node :


Closs A= 30 Sammples
Chas B = 20 Sample
Prstatkes closs A: Pa ) 20 0.6

r(e) - 20. - 0.4


befine en

and hostia
tntropy povenk cole
molels ?
tntropy (s)pasent =-0.6 x lage(0.6) - o.4 x

- 0.292 Comi

Now, le ehild in clas amd s


A of clas B

MOde
P(a) 20 = 0.75 P(B) o.2s
20

bntropy o left chid: th

tntropy (s)eff chld = o?s *


4- Re
0.244
Now child : is of clas A amd s)
30 30

= 0.30|
bwighed aweage tntropy hildren :
bntropy (chileben )= nd+ 30
= 0 x 0. 244 t 30 O.30)

= 0•2?82
Snfovmphon
gaán = porent - ckidven
z 0·2092- 0. 8
2.
Infovmokon
gain
as
mefhod, such
Hou do e memble
befoe ens emble deaming
mackine leannig
erformance and
sohual neos
and Aosthing inypsovo
the
maels ? that
Machine lea vming
1- Ensemble leanning mdel.
overall
ulkple Models to Cveate a Stong er
Comdines
Compared to indvical
acousney and askustntsi
a. A1MS to inmprove

models:
deffey ent ubsek
Modeb in pusllel
Baggng: Buids 'nultiple
s.

training data (( Examaple. Rondom


forest)

tobetey
pradchoa eading
4- Reduces Variance by oweaaging

guulyalen

: n the

) besting Trais Nodel sequentaly, zacth focuing


eSS0Y 6 he previows

type (ermple.
(ntodferent
a calegenige machiue leavainy ahoitamm

classifcakon, vegsession,
okeriny )Provicde exanplos
algontbmu

for cach tyte

laring alqoitn Typu


Mackiae

frehick disere te chs labels


3 Clacsifeaion:
tvees, suport
Vefor
decision
ie kezaession ok.
example: Logis

Machine (svm), Random forest,


aues
Neuv Nefo
Nekaw

cowknous Memornc
2. Reyession:
Predie F
,
QMomple : incas Agession, vidyo
Pslynomial
regresslon

Reqae salon, seat


Lasco

veclo
Regses ion,
(svR)
Regsessioo
cluutering: fraupe snilaa dala poiats into clasler wi li oul
7) Co
Pvedefned Labels

exampk: k- Means , Hiesauchieal chusting DescAN (density 4 De


Bascd spatal eustering Applicaton vaith woice),
hauscion mistue models (GMM)
4: bimcnsionality Reduchon: Redaes tne Naumbes sf fakuae

wich
shlch presesing important informaton:

Bhamaple : Pinclpal Compooet Amalyss (Pca),L- bitbute d


siochaste Neighboue enabed ding (i-sNE), lineas
Aistinánamt malysts ( LDa)
5. Reinforáe ment Learning:
Tiain aqent to make seqenia
deisions to maninige Cumahve Yewarolo.
brmple q- Leorning, Deep --Newok s (pq)
3) Eplain hou deci sion trees wok. ushat ae Hhe
advantagu f
Random foress over single decision trees ?
J.
Deision tree ase
Conposed s Nodes (feahues deison reez)
and leaves Couttomes)

Re cuasively divtdes data Based on feahne Values wsi criki


like
gin iapaaity s informakon
?. Traveese fmom
root to leaf bused on input to assig
3.
4:
Advanageu
Random forest oves
1) Aingle
Aveages
) predickons
Less sensitwe to
fvom
ad
mliple trees veduckon
Noise put leye due to
10,
ane
)Camhines Bagging
and Random featuse
data
mos

on Unseen
) More Reliable perfomance

Vec for Machine


A4 Describe Hhe vole sf kernel funehons in suppovt

amd how do affecl


(svM) sha ane Com mon Konel funchons,

model performanee 2

funchons Map inpu data into a Higher - dimensional space


1 Kernel
-
to make it easier to
to find
find a
a
seprating Hypeplane

Non. linea. decicion Bandaries wihoul


2.4ltouo sVMs to Cveafe

erliity tramaforming daa (ommon Kemel funckone.

neasly sepesable data equahon


Lineay Kernel: suitable for li

Phynomial kenel :Repescnl- paynonmial decision Bounday

tquakon K (xy) = (xy t<)

) 1.
Describe
numbee

The choice

Vay
oh

Bsased
the challenges

custers

Numbe
on the speite
f
ascociaed
in k- Meas

clustors

aplicahon
k
voith

alutering
cam

or
determí niug

confext
Aauljeck ve
the

omd
ptimal

Cnerid
a. while the elbou Mekoda byovides a visual t loe dfeutl
he" elbow scult.
to deternine poiat leading to anbigu
3. Silhoulte Cam dchate ith dfeven daksefk and

rovíde Conistent guidance on the Best Ki


4 k- meany tual tiye this Cam
asne
Micdead cluster
spherical
delexwinalion
clusters

in datasefs uith.
witk veguls tape.

Become
S. As he No o custeYs Ineseases he
4yoritom Mg
to outliers, Complí cakig
and Sunitve
Computatonally erpensive
the chote g k:

wshat u a newsal elwork ? eseribe He struefwe oj a bast <

does back- propaahon vak


feed -forwöasd neusal nakook. Hous

ay he
the theem
modil iapived
A Computakoal
(Newson) that form data
of interconnecfed Nodes

a. Used for taske like cascifi cakon ,hegsesion and pattern

regniton ay
By captulug node ( Neuasna) that from data.

stuctuse a baste feed foraacd Neunal Neho oh

nput layer
One feafuse.
: Receves tnpat featser uith aach repsesenh a

Q One or MoYe
Layer hat tramstorm input eighted
and achvahon functon.

3.
output Layes: Proces final oufpu iith the newron t
Newsom ovestonding to the Number o f canes oy a
Single Neuron for aeyaesion
abaiiHes for five data point
model redc
4 dagistie hegescion

a follows . (y) |e(y- /) Using he hseshs!


True clas
O.s to clasity

Hhe
1
oukpu,caleulate
amd aho fud
accwsacy
02 the vaue of
Fa-score.

clas
True clas (y) P(4) Predicted

noy

True

True
Posí tve

Negakive
(TP) = 2
(TN)= 2
(
C Cormecty predicked
( onectly predicted
i

o)
)
positve (FP)-0 (incovvect hy predcted 1s)
False

falce Negakve (FN)= ! (ncomeety predice d or)

TP +TN 2t2 = 0

Total

Precision 2
2+0
Tp tp

Recall = 0 -67
Tp+ PN 3

Re Call
F Score. 2 * frecision
Precision + Re eall
Describe Hhe weking Poinciple f K- meavesl- neigbbovs (Knn) n
classificakony: Hout does it make pye dickons baned on proxi mity
porinity?
1. KNN stores all the
dhe training dala inoul euiding am erplii

(
all

maded loyy leonig)


a. for a mas duto poiat KNN caleulater di taomte (tyialy
Euelidean) to all point in the training sek

k tvainiag points(heighloa)
2. The Algori #hm selechs the cto set

fbased on the calelated .


4: The cles f Nes dato poiat s delemiaed by the maj oiy
clom among is k aleavest Neh bar
paint n chuste clascied an the most clars in

ih neaves- Neigbboe.

vth featuses (3,5),and a KNN model


Given a neus dato poin
data
3 amd he fdlaaing tvaiaing
with K=

X clas

2 A
6
3
A

data point.
fredict the clan o the neu
(,,x,) (3,s)

JI3 = 3-60s

$-2) + (s- 3)- Ss = 2-336

bowa)

J(3-4j + (s-s) = J2 = 1-412

J3-) t (s- = Is = 2.2

model Based on abeve Resulk two classes are B and one das 4

:. The class ot data þoin (3,5) b B.

(10) An ens onadde of thse model achiwes an acewaey 4 so7, sSh.at

90%.,Aespechvcy if the modela one Conmbintd waiag maýjonity vefing,

shatis he expecled acewsacy he ensemble ?

Model 1

ANodell 2.
accvsacy : 80 = 0-80

Model 3 = 90/. = 090


frsbaläty that madel 9o correct =0•80 Ih Correc- -0:20
that Model 2 in CorYec =0-8s Intowvect- 0-l$

fröbali lity that model 3 corvect = 040 In correctojo


models prdic
at least two
The tnsendle
in correul-

occws
tf

in o0 Cases :
CovYe cl cax Thi

ane CorYecl
hsee Model
t AIl
ia incore c
one
Modeb at Correc
Q- Tulo
se Comecj
(ase s Al thuee models

)= 0•s0 * 0ss 0. 40 = 0 -612


P( All CoYre ch

I Tuo asc correct one is


on íncorre
Case

1)Model !
Models

and Model 2 coYect Model 3. in Corse

model 3
model 3 Covrec-, two in incorreef
n) Model and
and

= 0-80
)Model 2 and Mod el 3 CorYec, One s íncore

- 0-20 * 0-8S * 0-90 = 0ls3

P (Tuco Correct, one incorrect ) 0.068 t0-l0s +0-| 53

= 0.32 9
To tad protabilihy ensenmble Corre
Learnig
P(ensembte correch) = P(all Corvect)+ r(Tw0 lorret )
-0•612 +0-329

The
trpecked Aceusaey of ensenmde uing
maj oxi by

You might also like