- Consider the table of data below, which contains seven examples of the class value Pass based on the features Party, Sleep and Study. Suppose we want to classify the new instance <Party=yes, Sleep=yes, Study=yes> using the Nave Bayes learning method. Compute the following. Show your work. Note: use the add 1 / |values| method if the original P(feature | class) = 0.
Party | Sleep | Study | Pass |
yes | yes | no | no |
yes | no | yes | no |
yes | no | no | no |
no | yes | yes | yes |
no | yes | no | yes |
no | no | yes | yes |
no | no | no | no |
- Compute the prior probabilities P(Pass=yes) and P(Pass=no).
- Compute P(Party | Pass) for all combinations of Party {yes, no} and Pass {yes, no}.
- Compute P(Sleep | Pass) for all combinations of Sleep {yes, no} and Pass {yes, no}.
- Compute P(Study | Pass) for all combinations of Study {yes, no} and Pass {yes, no}.
- Compute P(Pass=yes | Party=yes, Sleep=yes, Study=yes) and P(Pass=no | Party=yes, Sleep=yes, Study=yes).
- Which class would Nave Bayes choose for the new instance?
1
- Train a perceptron on the 7 examples from the table in Problem 1 and then use the trained perceptron to classify the new instance. Specifically,
- First, translate the examples (including the Pass class value) according to the mapping: no 0, yes Show a new table of examples using this mapping.
- Train the perceptron below by updating the weights according to the perceptron learning rule (slide 34 of Learning lecture). Assume the initial weights are all equal to 1.0, and the learning rate = 0.25. Consider each example in the order presented in the table in Problem 1 and show the weight updates for each incorrectly-classified example. Continue until the perceptron correctly classifies all the training examples. Show the final perceptron weights. Hint: The perceptron should correctly classify all 7 examples on the 3rd pass through the examples.
- How would the trained perceptron classify the new instance <Party=yes, Sleep=yes, Study=yes>? Show your work.
- CptS 540 Students Only: Put the 7 training examples from the table in Problem 1 into an ARFF file suitable for input to WEKA. Follow the procedure below to run the Naive Bayes classifier.
- Download and install WEKA from cs.waikato.ac.nz/ml/weka/downloading.html.
- Start WEKA and choose the Explorer mode.
- Under the Preprocess tab, choose Open file and load your ARFF file.
- Under the Classify tab, choose the bayesNaiveBayes classifier.
- Under Test options, choose Use training set.
- Click Start to run the classifier on your data.
- Include your ARFF file and WEKAs output in your submission.
2
Reviews
There are no reviews yet.