0% (1) 0% found this document useful (1 vote) 38 views 21 pages Machine Learning Problems
The document discusses various machine learning techniques, including hypothesis generation, k-nearest neighbors, linear regression, polynomial regression, and Naive Bayes classification. It provides examples of how to apply these methods to datasets for tasks such as predicting student performance and sales forecasting. Additionally, it covers the computation of distances, probabilities, and regression coefficients to derive predictions.
AI-enhanced title and description
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here .
Available Formats
Download as PDF or read online on Scribd
Go to previous items Go to next items
Save Machine Learning problems For Later Machine Leawning — BCS602
ea St at eo Ph gga ee
instantesa
4. Comsides the training dataset of 4 in of
Enjoy spol: Apply the Find S-Algositivmn
. Enis.
Example Sky [AtrTent | thimidity| iaind | ates Faent Set
Lo Sinny | Wa any Nosmal Strong Warm) Same | Ves
Sunny |. Warm High
| 2 Strong Wasm| Same | Yes
fe Rainy | Cold High 7
\
4+
strong |wawm| Some | ie
Sunny | wasn High
Strong Jory [Same ly.
Solution +
Step + Stet with the most Speci fie hy pethesis:
TnitiaL hypothesis h= Le, bbs, 4,6]
») Stee Update -h wring “positive exam ples only.
Nosmal,Skrong Warm,
Somer]
™ Same)
Tesation 2. (positive): [Sunny »Waam > tigh, Staong, Waam,
Compate’ with b { Same)
Sky: Sunny = Sunny >" keep Sunny
| exalion 4 (positive) : [Sunny shann 5
| Update hh: he [Sunny Warm, Nonmal, Stang, Was
AisTemp: Waams Wom —> keep, Warm
temidity ; Noamal + High > Set to 7
Wind : Strong
= Strong > keep Stacng.
Water: Waam = Was —> keep Wasm
Forecast + Same= Same —> keep Same
Update bh: b=[Sunny >Wasm, 2, Strong , Waam,Same ]Tenation 3 (Negative) —> Tanore
Iteration 4 Cpesitive)
Sumy, warm, High, Stamg, Warm. Same }
Compare put be All attzibutey match on alseady 2.
So, no change
Finab Hy pethewis 7
h= [Sunny. Waam, ?, Staong, Waam, Same |
ae
6. Crsider the Shudent performance training
dotasek of % Instances givew in the table,
clarify whith, a Student will pass or fail
yy the course bared ow b-NN method.
Pind (K=2). Given a tert instance (2.1, 40,5)
B dad Capa | Assessment | Pagjeck Submited] Result
L a2 35 S Pare
2 @ se 7 7% Poss
eS a5 ca 8 Pass
4 6 ae 5 Fail
5) 65 50 4 Fat
6 a2 72 7 Fons
7 5-8 ag 5. Foil
8 8.4 21 4 Past.
Sstudion.
Stept: Calulate the Euclidean distance bekween the
test “instance (6.1.40,5) and eady of the training
Inte tancer -
Foam for Guclidean, distance -
ist = : 7
a \ Oy ny” + Gar y+ Cea- Yr
ere 1 %2,Xe_ = Given imstance Values
(6.1, he, 5)
Mr Yards = Values of each ani ning inpteneetemt | PRO) | Rewbl|
[Link] | COPA. ‘Assessment Submited |
Cs-8)*
y Vieqs.76
* 41.1746)
!
the fe eS
(40-454
(s-s)*
-fo-o14as+o
| J= (25.0)
> 5.00}
—_—_—_—
at to |e Nero
. (4o-50)*+
G4
> flol-te. = 10,05781 TE fata 1] peed Poo | [G18 2)? (40-724
Ta
¢s-7)~
= 32.1314
t
I
5 [Pal | (er-sei Gear,
Cs-sp-
0.044440
- V4.69
= 2.0223
23 Pass (e Ee a (4o-an¢
+ (5-4)
"784 +2601+ 16
= $2624.84
= 5I-23319
Step 2: Sort the distances iy Ascend.
other amd
Seleck the (vst 3 heart Taaining dale ing bines
wo dhe tet ‘mstances. Swnee (k=3)
1y 2.0223 8> 51.23314 '
i
27 5.00] The fist 3 nearest training deka.
2 10.0576 instines one
Ay o2.1ony ly &ocag, — Fail
a> 40.0450) Q> 5.00, — Fal
Gr -AL. 17961
T> 45-2063
3> 10-057¢~ Fach
SeStep at Predict the, less ofthe. Teak: ing Knee a
. majority voting.
The claws for the -test- ae is predided as
“pi
Ff Crsider am example uchere the five nvcks sales
data (‘in Thousands) is aevem an Shown below in
Table. Azply Uneas Regression, technique -to predict
Ake 7 amd at
moth Sales.
vi
(Sales iw Thousands)
12
1.3
1246,
32
33
Po ee
Selution - To preset: the Th and al weeks sales using
ieee Regression + we fiat fit a straight ine
whe, X= 5
Y= sales”
ya athe,
eCq.0
age Inkeacept
de= Slo reStep 1 Constauck lhe Computation ble and
4 Pind recemany values .
xj Yi | Com Xray |
p o4 V2 ! L2
Baise Be ce 4 3-6
i 3 : 2-6 ; 4 7.3
4 3.2 \6 12.8
5s 3.8 25 ne
Sum = 15 Sum=12.6 | Sum= 55 Sum = 44.4.
Average (i) | Average (Yi) | Average (xi) | Average (%i#y))
. Lee
Hea’ Covrputs ste and ieee wring
foxmuta : :
: “= OV) - OG)
2
-()*
a =(Y)-ay RX ; |
, i
a= 9.8% —B(as2) _ ¢.es—756 _ 1.32 20.66
; yo w=-4 a (row,
%o= 256—0.66*3 = 3856-|.48 = 0.5H :
a= O-D&
‘aeSp SB. Model the selationship wing 8410”
Ya eo + 1%
ard a, 2 a) iw above ewan
Y= OGY +0.66%
Step. prardick for ai and ai useck.
th
Fox usec > Y= 0.54 4 0.66 (4) = 0.54 44-62
(xt) i Gq = 316)
in :
Fox 4” use Y= O54 10-66 (D = 0.54 45-44
ae | (x= ee |
Final Aner + op ywecck gales a 5.16 thousand
a uscok Sales 2 6.48 thousand
ver date provided. and Apply
@ 9. Conyider Dhe 9
Palynrmial Regression ‘and sdve it (Use oxder=2)Sdudjen : : pot
| Step ts Constauik the Computaion table & recess
7 Eo Vales
2 3
Hl ti [| i Pye x
t ! ; \ 1 Il 1
& Ho fos®e Tek le eo] te
3 q at 4 3\ at 8|
4 is | Go lo Bho | by 956
Santo | Bayi 84| Say Ae | 20 | 2-28 Sed loo |e
!
| Hepa. Th can be nebed that N=4, Dyi=295
Sui = 96, Zxhy, = 338.
When order i¢ & the matyie
| Is owen ax »
N SH, Say Xo yj
Sy So SP | 1 | Sey
Sx se sxe |(| | Sah yo
hy is of the form XasB. Oe gmao--
Tk can be Witton ad azx<'p
4 10 30 Xo 24
1o 30 loo ay = 1 46
. 28
30 \00 354 a, 3ao bo} Fle So ] 24
x
ay: lo 30 loo 46
ai ag be 354. 338
—6o,75
6.95
o.75
ep 3: “The Regression Squotion is Gjome: by.
Ye oT Aye Foe
Yr -OFs + ons tone |lo. Covet gure ov Regression tree wring the fAlenting
‘ dable uehicd commists of 10 cata Instances and
+ = & athibutes ‘Assessment 1 Assignment and
“Proyere. The —tangek attribute is he "Result wshich
is comtinues atbibute.
ashe | Assessment | Assignment: | Pasjeck | Result (4)
|
| 1 Good Yes Yer 95
fee. Aveaage Yes No To
3 Good No Yes 75
4 Poor No No
. A
5 Good Yes Yes a3
6 Average No Yes £0
7 Good No No 75
8 Poox Yes Yrs » 6S
4 Average No No 6s
lo : Good Yes es 84
Solution :
| Step : Compute Standard deviation fer eady atribute wat
| +o he tang alribule +. -
ve - os ‘
A we = 95470475445 498480475 + 65+5e+494
\o
= 750
to
Average = 75
Strndawd deviation = [ 5-75)" Go-7sy + sey +
C4575 4 @s-75)+ (S0-75)+
C75-75)>4 (65-76) Ge-75 y+
C84-75)>| Assessment = Good
Ss danesement Aswignnsa | Result (7)
1 Good Vox 35
ne Good No 75
8 Good Yes 98
log Good i No - 75
lo Good Yes 39
|
Average = (854754964 75489)
{ee
5
= 432
S
Average = 86.4
(95-8e-4)"+ (75-86.4)*+ (e-s64f
+ (75 -86.49 4+ (63-86.4)>
S
Standard Deviation =
Standond Qeviakion = 10.4
Aswesement 2 Aye vage
SLNo | A seeeement- _ Assignment | Result Gy
2 Ave wage Yea Jo
é Average No so
q Prvesage No 58
|
Average = Fo+to455 i
soo A
3
Pverone = 206
Average = 169.3Sondesd Deviation = Go-64.3)*} (¢0-€9.3)% 6s-6qay
See Ne
Assessment= Poow
Li Ne Asecsement ( Pei apo ment | Result ()
ls 4 Poor No | As
Weg bp Pere Yes ' | 65
= illo
z RN
Fi / 5
Standovad Beviation = 44
oT
Standond deviation amd Sota mstances
=55
No}
I 1g
Weigtted Standond deviation foc AS 685 men —
= (10.4 +3 or) +2
> (l0.4) Se We) = 4)
= IS
hte deviating deduction for Assessment =
l6.55-53 = 4.07Awe ment: = Yes
Assessment | Asoigwment | Reult-
Gro oy, yes os
Drevage yer 70
oy ool es. 98
Pony yen os
Good ye 20
Ave sage = 99+70 493465489 = 417 C2.4
Eee
S 5
Standard @oviatiog =
(s— 32.44 (o-8 34) + (Cag -33."
+ Ces- 83.04 9-83.97
ee
Statand Quintin = AS
Assiqnment = No
[Link] \ 458 extent A Signet eae
a Geod No 7
4 Poo io ie
6 Avevage No Be
uw Good No =
' Prema No 5g
Avenage = 754454 20+ 75458
= G66
i)
Stomdand Boviaking =
ee 66.0)*+ (45-66.6)"4 (G0-Ge.0)" +
(75~66.6)* 4 (58- 664) /s
= AATze nabances fer asi but
Aswigmanet-
Standard Mevialin | Oalar Lastrnees
Standard Meviatiny and Oat
Agere ssw ente
ae a8 5
wyes
No ' 14.7 S
A |
Weigttled Standovd deviation Pov Asslanment =
5 (8) +S. (4.7)
\0 ry
‘ : = 14.84
| Gkandand Deviating seduction -for Assignment =
; | dee 16.55 — Ih. 84.
= 7
| Slandaad deviatim Reduction fy Each Mribute
Atsibutes Skandavd deviation Reduction
Assessment A497
Assignment Stk
Since Assesement’ has the marimum Standard
deviation Acductinn LE is cheoter ag the best
Spretingy atribute.Const mrt Repression Trace
Assessment
No | 75
No |75 Ei sob on Jel Jounin
Ghee! ps [go] |
“se & [Pos
4 a No |5¢
113. Access a ekideadls peafoamance using Naive
\ Bayes algorithm uaith the dohaset provided im
| he tables Pardist mehither a Stident gels a job
offer om notin his Final ngiar of the Course.
\ [Link] | capa \ Tick enactivences | Tob Offer
i t nal ~ Yes Ujes
f a Bee. ‘ No Yor
OS 24. No F No
i 4 £4 No No
| 5 we Yee. ‘fet
pe z4 Yes ‘Yes
| ot <3 Yess © No
as xA No qe
ae 2s Yea es
lo 2 ~ Mes | Yes
Step Compute. the prise Probab tity for "T5b Offer’
Poor patbaliddy for ‘Teh Offers = ayes
= Yo .
Patos pasbali'vity for “Teo offr="No = 2
a : 10
To offen Clauws | Ne of instances | Paobabi ae
ee [Ne |
Ves i Shs 7 ; PCHbO Fe =yen)a7,|
No) j ,
ro PGrborter- ny) =¥,Saree Compute Faequomy mooi andi be keliberd
Pasbabitity Tov cath spthe fanlre,
20) Featiue— cer 4
The Of fev=No
2a ie
re 4 °
<8 ° ae
Teta 7
Aeon?
(2b) Feline — Interact vernsys
Ukelihecd probability OY Caer
CeyPee | F Gr ofa = yes) | PCS effer= Ne)
24 Pearary4 ITeb 0 Ff yes) Ya ¢
= 24
we 444 La
<8 oF Ba,
a
Faeg uemy matrioe of Inteoackivencis
z Diberact veness Tob Offer = Yes
Tob Offer= No
5 4
g &Lileabé hood probability, x Dita veness 1
| Teter ackivencns | P(Tsb offer = Yer) [rome ofl =)
ad Ys
“e 4 4s
| 322. Use Baues theo equetinn—te © aS
|| dhe Parbol lity Fy ote hugpetheses.
DS Offer = yes | Test data =
P (CaP 4 [Tc Offer = Yes). P (Deternctiveness =Yos| |
Tsb offer = ye)
+P (Dt offer = yes) |
|
14
ie |
P (Sb offer = No| Test data) = |
P (Capa >4 | seb Offer=No) - P (Drteractivencss yal
Te of fir=neo) |
: +P Gib offer = No) |
= 1 x ut x Apo :
ag OT
7 oS = 0.0333 |
30Stef: Use martin A poskeriat (mae) by pathasia
bar Cynaterr to classify the sagt sbjot—to
—the kypotheis with the highest prsbabes tba
Since Gib offer yes [Test data) has the hughest-
value , Dhe Hest
Jeb Offer, = Ys
oS
Acta is classified as
I4- Consider te Sample data given in -lhetable.
usith 2 featiaes x and “Y The thaget classes are |
Predict he Class UALna- Neasoxt—
Cemtacid § claspi fies .
Note : Chiven test instance. is (6.5)
© pa dice he clos.
fA’ or 6B,
7 We COM
|Step | 1 Comp rnte the mean |eent rcidl of cach alias
Tn Bir example. Whne ane 2 eauccs Aled “A |
ond B" .
Contnsicd of Class’! = (245+4,14243) =(2 6)/a
3 = (4,2
Contant oa clans = (tote e6t78): (ai, is)fa
: “ = (7.6)
Neue given a este instance (6,5) tte cam
Predict Ate efass.
St @: Calculate the Euidean distance bel elieeen
ett instance (6,5)° and “each Othe Cent wid.
Eve ist [(6.5) 5 i 2»)= (6-44 (5-2) = Viz =36
wist [(65); Gey] = \|(e-7+ (S-6F = Ve ab aig
ie Step a. The 4st instance’ has smaltir distanced
classy Bo Hemee tte Claas Ais teat instance
is predicted ay SB