Sei sulla pagina 1di 9

1.

X = ( age= youth, income = medium, student = yes, credit_rating = fair)


Create above data set in CSV format and predict a person belonging to tuple X will buy a
computer using naïve Bayesian classification in R.

Q2:
2.
Tuple x is

Create above data set and predict a person gender belonging to tuple X will using naïve
Bayesian classification in R.

3.

4.
Create above weather data set and Find out the possibility of whether player play if weather
is X=(outlook="sunny",temp="cool",humidity="high",windy="TRUE") using naïve
Bayesian classification in R.
Answer:

Suppose you have a database on four customers. You know their gender, income and
whether or not they bought your product. Create a data frame with this data.

## buy income gender


## 1 yes high male
## 2 no high female
## 3 no medium female
## 4 yes low male

1. Using Bayes rule calculate the probability that a customer will buy your product
given that he has high income and male.
2. Estimate naive Bayes model using your data above. What is the prior probability of
someone buying your product? What is the probability that a customer has a high
income given that he or she bought your product? What is the probability that a
customer is male given that he bought your product?
3. Using the model you estimated above, predict the probability of buying given that a
customer has a high income and is male. Is your result the same as the one you
calculated by hand in question 1?
1.

X = ( age= youth, income = medium, student = yes, credit_rating = fair)


Create above data set and predict a person belonging to tuple X will buy a computer
using naïve Bayesian classification in R.

2. outlook temp windy play


1 sunny hot FALSE no
2 sunny hot TRUE no
3 overcast hot FALSE yes
4 rainy mild FALSE yes
5 rainy cool FALSE yes
6 rainy cool TRUE no
7 overcast cool TRUE yes
8 sunny mild FALSE no
9 sunny cool FALSE yes
10 rainy mild FALSE yes
11 sunny mild TRUE yes
12 overcast mild TRUE yes
13 overcast hot FALSE yes
14 rainy mild TRUE no

Create above weather data set and Find out the possibility of whether player play if
weather is X=(outlook="sunny",temp="cool",humidity="high",windy="TRUE")
using naïve Bayesian classification in R.

3. Suppose you have a database on four customers. You know their gender, income
and whether or not they bought your product. Create a data frame with this data.

## buy income gender


## 1 yes high male
## 2 no high female
## 3 no medium female
## 4 yes low male

4. Using Bayes rule calculate the probability that a customer will buy your
product given that he has high income and male.
5. Estimate naive Bayes model using your data above. What is the prior
probability of someone buying your product? What is the probability that a
customer has a high income given that he or she bought your product? What
is the probability that a customer is male given that he bought your product?
6. Using the model you estimated above, predict the probability of buying
given that a customer has a high income and is male. Is your result the same
as the one you calculated by hand in question 1?

4. Load Data set Student.arfff and execute the following using WEKA.

1. The number of instances (data points/records) in the data.

2. The number of attributes (features) in the data.

3. List all the categorical (or nominal) attributes and the real-valued (or
numeric) attributes separately.

4. How many numeric and how many nominal attributes does this dataset
have?

5. Apply discretize Filter and display data before and after applying filter

5. Load employee.arff dataset and determine the following using WEKA

1. How many instances does this dataset have?.

2. The number of attributes (features) in the data.

3. How many numeric and how many nominal attributes does this dataset
have?

4. What is the range of possible values of the attribute salary using


discretization?
5. Apply the following filter and show the results.

a) Add or remove some attributes of the data set.

b) Apply RemoveRange and Remove Missing Values

6. A database has 9 transactions. Let minimum support 2 and minimum confidence =


75%.
# T100 {I1,I2,I5),
# T200 {I2,I4},
# T300 {I2,I3},
# T400 {I1,I2,I4},
# T500 {I1,I3},
# T600 {I2,I3},
# T700 {I1,I3},
# T800 {I1,I2,I3,I5},
# T900 {I1,I2,I3}
Find the frequent itemsets and association rules using Apriori.

7. A database has 9 transactions. Let minimum support =60% and minimum


confidence = 75%.
# T1 {B,C,E,J),
# T2 {B,C,J},
# T3 {B,M,Y},
# T4 {B,J,M},
# T5 {C,J,M}

Find the frequent itemsets and association rules using Apriori.

Potrebbero piacerti anche