Dsbda - Solved Numeric Pyq
Dsbda - Solved Numeric Pyq
Page No. :
Date :
Ut:4 -3M
Suppose ou g'ven a datase+ containing inormation
a bout whetther emails qre spam or not spam, along coith
oo fetures:
i. the pre Sence cf the coord "offerlipresent, 0:a bset)
i the presence af the cord Free"(:present, 0:absent)
You are Aasked with chssi fying new email with he
follooing features Ualues. "O£fe) ree' l.
Giyen the roini hg dataset :
ErmailOCfet PfreeSpan
No
2
yes
3 yes
4 No
yes
Calculate probability that he neo email is spam toing
Naive Bayes.
i. Gven:
Total emails:S
Spam -Yes : 3
Spam No : 2
Telegram Channel
https://t.me/SPPU_TE_BE_COMP
(for all engineering Resources)
WhatsApp Channel
(for all Engg & tech updates)
https://whatsapp.com/channel/
0029ValjFriICVfpcV9HFc3b
Insta Page
(for all Engg & tech updates)
https://www.instagram.com/
sppu_engineering_update
VEDHÂ
Page No.:
Date:
3. Plorser-t/spam Mo)
P (iree sl spam o) /2
UApply Niue Bayes:
a. Pspam yes/ot Ker -t, Brees)oc P(SAum). P(osterst spam:ya
p(Eree-t/spam yes)
:3.2.12
S 3 S
VEDH¤
Pago No.
Date
V. Normalize:
S 2
PSpam) /s
S
p(Not spo) o o 0 . 2
Ans:
he probabiliy thot the new email th
CÊ fer =1& Areesl, is am is Q-9So)
VEDHÂ
Page No. :
Date:
-9M
Syppos e you have the follouing dodaset containing the
LCoordinates of points in aa 2 dimensionad space.
PointX(oordinadey- Coordinate
2 3 perorm
Kmeans clu tering.
B 7 Assume initial cen-trnid
C s) &(3. 6).
D 6
6
7
i. Tnitial centroids:
RecompuBe Centroids:
Clastr (G) : Points A23), c(3.5)
New Certroid /23, 345 (2s4)
2 2
(6-25, 7-)
Teration2: Distance to
Point Coordinates C(2-5,4)lalG.es.c)TVewç aster
23 1:1| 6-18
B 4, 7 3:3S 2-30 2
3, S 11|
D 6. 9 610 2
E 8. 6 230 2
7, 602 2
Centroids remain the same as in îBeration 1/
- (on verence reached.
:.Pinal Clustes & Cenrojds.
Cluster 1 Centroid CG): (2.s, )
cluster 2 Centoid C): C6-es, 7.5)
coith asifments as
Cluster : A,D. C
cluster 2: B, D, E, E
VEDHÂ
Page No. :
Date
- SM
Ut:4 Confidence value for al!
Calculade the Support &
Support
Supportcount
i.ist al items & count Hitemset
2
Colddrink, Burgera
i Colddrin k, Egs 2
icolddrink,MIk 20thh
11
iBurger. Ejgs 20%
iBurger, MiK
2
VEDH¤
Page No. :
Date :
Colddrink’Onion 4 7S2
Potato ’ (olddrin k
3 6667.
Colddrin K Potato
2 3 66-67.
Potato ’ Eggs
E9s Potato 3 66 67l
Potato’ Mìlk 2 66-6Z/
MiK Potato 2 1004
Colddrin k Burçer 2
Col ddrink 2 2 b b i o (o0%.
Burger
2
Colddrink Eggs 2 3 66-67t
Colddrink
MiIK E3g3 2 2 100
Mik
3 66671
Onion'5 Potato 3 33.34%
VEDHÂ
Page No. :
Date
Ut:s eeoh 9M
Suppose that the given data the taste is to
cluster points (oith a) representing locadiun) into
three cluster. qohere the points are
re :
AL10) A2(2, S),A3(8.4),
BI(S), B2(7.5). B3(6.)
CL2), C2(49)
The distance function s Euchidean distance, Sppose
iniHaly sipn Al. B\, and Cl as he cener of
each cluster, Tespectuely. ise the Kme ans algotit hin to
shoo only the Og clstes cen tes ofter the
irst round of execuion wtth steps.
Tnìial Clusters : Centroids)
i. cluster (C): AL(2, 10)
ih. Cluster 2(Ca): BL(S, 8)
iii. Cluster g (Ca) : C1(,2)
Heratiorn l: Distance to
Point CoordinatesC(2,10)G (s, 8) Cs (, 2)luser
Al 2, 0 3-6/ 8.06
A2 2 S 3.16
A3
4.24 Cs.
8, 4 7:22
B) 3.61 7:2)
B2 7,S 7.07 3-6/ G08
B2 12
6.4 7.21
1 2 SO6 7.2) C3
C2 49 2.24 7.07
VEDH¤
Page No.
Date :
-6.6)
Clustey 9: G Azl2,s); CH(.2)
'Neco (eintroid/2+1 S42 (:5,3.)
2
Confusion Matrix
AcBuaredited yes (Risk) GNo (Ris K) Tota
Yes CRiSK)8o 220 (FN) 300
Ao (Risk) SO (EP)*9s00.(TN) 96so
O the model.2
i Accuracy: Measares Correctness
9628 96-287
ett
The model s 96.28% Correct acrU Ss hoth classe
i. Precisìon
Measurs hou many predicted ye" cases
0ere actually trR core ct.
Precision: TP 0
TH Fp 30+IS0 30
0.3478'=34:
only
only 39.78 of predicted"yes as es trüly shadi
heart attack rìsk.
Ut:s
-3M
Given the confusion maix. Calculate Accuray, Pre cisiun,
Re call. Etror Rate oith desciption on Diabetc Risk.
Predicied classes
|Diabe+c
Classes Diabetc Ris
Confusion Matrix
Actua redicted Yes (Pisk) No (Ris k) Total
90+9560 0.96S =- 96
Tota 10,00 0