ML Assignments
ML Assignments
chasihaton
mehedlain
0 Cplore lhe Concepl
sf entemlle
and
tt fouses move
for miscas sifed insmces in each Aound•
Cases
t
to vecluces msoA amd boost oveval
dhalugig
Model perornenee
Suitasle
shere
Appkeakon:
behavio
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
baned
algorithms ( erample, SVM, K- NN)
Describe the qndient destent optimiyai on algonkhm
Lzavnang Rate : contda the step: &ie for each update. 4 high ate
Hhe
ere a paaiabikty ske jerpechve a benefeial in
Ktuakion
data
anayis
ee
tb clas labels . ding in interprepble pyeik ons
Descr
and
pdate
sein
madel
forcemenl
in sequenhab dcision - making
beliefe, wseful
karning
valu able whern deta is
,
bias. Vaviamce in
Define Hhe
Stvategies to balamce ;
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
algonilim Comvevganie.
:
Categovieal
qorical
to'interpret them.
algorithms
encodig ), alloaig
(ecample oNe -hot
Interackon feakuses : Combines featues (eple : alipyi g
he or
ghh ke week
day
: Extracks insi
Date/ Time
uon
season
Feahse Exhracton
inpsoves model
e tfeckve feaue engncening
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!
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
more data.
Uhderfting: încrease
îne meodel Complealty, tune yerparamelers,
better featuves
or engineer
perfomance
a madel ierativdly,proiding a more &eliable
estimate:
the modl
Importaue; It þrevent overf tivg by enauving
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
Ovevall pevfovmance -
f3,-(-4,-),
, = (-1,+),Ms- (+i,
shattered
dy svM
+1)4
clansif'er
with Hhe
Kernels 2 all
seperate
Cam perfectly
Meam that the clasike
Shatering
the focal þoink.
for
Label assiqmment
posibk
=
input poinh
Dalaset confains fous
labelings of
(4,-),
the daasete.
(it,+1)
(a1,
a': 16 possible
a) Linear Kernel
straigat
ineas classi fer can ondy sepanat poinh uing
labellings
he daasek Can be
o
not all 16 possile ine.
lines
b)
infinite dimensions.
4
fail
65 So
fail
8•2 Pass
7 38 fail
9 fas
091
(8-s) = 22.2
t C6o- 38) +
31- 04
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
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)
-0.146|
Inform afon gcán for
mavtial stutw
.maried
snhsy (s
)
)
=0.26440|461
0l|83
2) Credit
Values cvedil
ccore ) = > 680 < G80
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
Credit score
Credit Score
Yes No
cmcl Hhe per Sn
6f Covariance
stalis keal
A Determine
Coefficiont for
the
the dafaseh
measnse
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
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
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
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
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
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
4
Sanifcand feahae aith lnqe cocfffeienk ase criical for
Reduadang
a. The msdel
assames Conditional
independauce
anplafyig the Qumong feahne
Comutahon of joint
probaliities as a
a froduet
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
velue of
Y Mean
eYYOY (Y:-y)
Mean sequred
anel 20
cpts
class B) into to
node
child nodes .
The deft child
the Right
has
here
ft Hhe Proportion s amples in elas i omd e s the
number classes
and hostia
tntropy povenk cole
molels ?
tntropy (s)pasent =-0.6 x lage(0.6) - o.4 x
- 0.292 Comi
MOde
P(a) 20 = 0.75 P(B) o.2s
20
= 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.
tobetey
pradchoa eading
4- Reduces Variance by oweaaging
guulyalen
: n the
type (ermple.
(ntodferent
a calegenige machiue leavainy ahoitamm
classifcakon, vegsession,
okeriny )Provicde exanplos
algontbmu
cowknous Memornc
2. Reyession:
Predie F
,
QMomple : incas Agession, vidyo
Pslynomial
regresslon
veclo
Regses ion,
(svR)
Regsessioo
cluutering: fraupe snilaa dala poiats into clasler wi li oul
7) Co
Pvedefned Labels
wich
shlch presesing important informaton:
on Unseen
) More Reliable perfomance
model performanee 2
) 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
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:
ay he
the theem
modil iapived
A Computakoal
(Newson) that form data
of interconnecfed Nodes
regniton ay
By captulug node ( Neuasna) that from data.
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
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
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
k tvainiag points(heighloa)
2. The Algori #hm selechs the cto set
ih neaves- Neigbboe.
X clas
2 A
6
3
A
data point.
fredict the clan o the neu
(,,x,) (3,s)
JI3 = 3-60s
bowa)
model Based on abeve Resulk two classes are B and one das 4
Model 1
ANodell 2.
accvsacy : 80 = 0-80
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
1)Model !
Models
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.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