Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
9th Edition
ISBN: 9781337669405
Author: FARRELL
Publisher: Cengage
Bartleby Related Questions Icon

Related questions

Question
Q1):  Given the following dataset
Restaurant waiting: the problem of deciding whether to wait for a table at a
restaurant.
For this problem the output, y, is a Boolean variable that we will call WillWait.
The input, x, is a vector of ten attribute values, each of which has discrete
values:
1. Alternate: whether there is a suitable alternative restaurant nearby.
2. Bar: whether the restaurant has a comfortable bar area to wait in.
3. Fri/Sat: true on Fridays and Saturdays.
4. Hungry: whether we are hungry right now.
5. Patrons: how many people are in the restaurant (values are None, Some, and
Full).
6. Price: the restaurant’s price range ($, $$, $$$).
7. Raining: whether it is raining outside.
8. Reservation: whether we made a reservation.
9. Type: the kind of restaurant (French, Italian, Thai, or burger).
10. WaitEstimate: host’s wait estimate: 0–10, 10–30, 30–60, or >60minutes
 

Please show work and equations etc.   no cdoing required .. 

A):  [Alt = “Yes” , Bar = “ No” ]
B):  [ Alt = “Yes”, Bar=” No”, Price = “$”.   

 

 

Input Attributes
Output
Example
Alt
Bar
Fri
Hun
Pat Price Rain Res
Туре
Est
Will Wait
X1
Yes
No
No
Yes
Some $$$ No Yes
X2
Yes
No
No
Yes
Full $
SS
French
0-10
y₁ = Yes
No
Thai
30-60
y2 = No
X3
No
Yes
No
No
Some $
No No Burger
0-10
y3 = Yes
X4
Yes
No
Yes
Yes
Full
$
Yes No Thai
10-30
Y4 = Yes
X5
Yes
No
Yes
No
Full
$$$
No Yes
French
>60
y5 = No
X6
No
Yes
No Yes
Some
$$
Yes Yes Italian
0-10
Y6 = Yes
X7
No
Yes
No
No
None
$
Yes
No
Burger
0-10
y7 = No
X8
No
No
No
Yes
Some
$$
Yes
Yes
Thai
0-10
y8 = Yes
X9
No
Yes
Yes
No
Full
$
Yes No
Burger
>60
y9 = No
X10
Yes
Yes
Yes
Yes
Full
$$$
No
Yes
Italian
10-30
y10 = No
X11
No
No
No No
None
$
No
No
Thai
0-10
Y11=No
X12
Yes
Yes
Yes
Yes
Full
$
No
No
Burger
30-60
Y12 = Yes
Apply Naïve Bayes Classifier to classify the following two samples.
expand button
Transcribed Image Text:Input Attributes Output Example Alt Bar Fri Hun Pat Price Rain Res Туре Est Will Wait X1 Yes No No Yes Some $$$ No Yes X2 Yes No No Yes Full $ SS French 0-10 y₁ = Yes No Thai 30-60 y2 = No X3 No Yes No No Some $ No No Burger 0-10 y3 = Yes X4 Yes No Yes Yes Full $ Yes No Thai 10-30 Y4 = Yes X5 Yes No Yes No Full $$$ No Yes French >60 y5 = No X6 No Yes No Yes Some $$ Yes Yes Italian 0-10 Y6 = Yes X7 No Yes No No None $ Yes No Burger 0-10 y7 = No X8 No No No Yes Some $$ Yes Yes Thai 0-10 y8 = Yes X9 No Yes Yes No Full $ Yes No Burger >60 y9 = No X10 Yes Yes Yes Yes Full $$$ No Yes Italian 10-30 y10 = No X11 No No No No None $ No No Thai 0-10 Y11=No X12 Yes Yes Yes Yes Full $ No No Burger 30-60 Y12 = Yes Apply Naïve Bayes Classifier to classify the following two samples.
: import pandas as pd
file_path='/Users//Downloads/Data 2/ExampleTrainDataset.csv'
filepath2 = '/Users//Downloads/Data
data = pd.read_csv(file_path)
data2 = pd.read_csv(filepath2)
2/ExampleTestDataset.csv'
print(data)
print(data2)
x1 x2 x3 Y
012345678
2
3.0
2 0
2
3.0
4
0
2
3 9.0
1
0
3 1 0.5
2
0
4
2.0
1
0
5
7
2.0
1
1
3
2.0
5
1
5
2.0
2
1
8 2 4.0
3
1
2
226
11234
9 3 2.0
0
x1
1 1
x2
x3 Y
2
6
3 7
4 3
32243
3 1 0
2
4 0
2
2 1
4
3
31
3 1
1 1
expand button
Transcribed Image Text:: import pandas as pd file_path='/Users//Downloads/Data 2/ExampleTrainDataset.csv' filepath2 = '/Users//Downloads/Data data = pd.read_csv(file_path) data2 = pd.read_csv(filepath2) 2/ExampleTestDataset.csv' print(data) print(data2) x1 x2 x3 Y 012345678 2 3.0 2 0 2 3.0 4 0 2 3 9.0 1 0 3 1 0.5 2 0 4 2.0 1 0 5 7 2.0 1 1 3 2.0 5 1 5 2.0 2 1 8 2 4.0 3 1 2 226 11234 9 3 2.0 0 x1 1 1 x2 x3 Y 2 6 3 7 4 3 32243 3 1 0 2 4 0 2 2 1 4 3 31 3 1 1 1
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Text book image
Operations Research : Applications and Algorithms
Computer Science
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Brooks Cole