




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Main points of this exam paper are: Linear Classifier, Bayes Rule, Probability, Operating System, Decision Tree, Information Gain, Learning Algorithm
Typology: Exams
1 / 8
This page cannot be seen from the preview
Don't miss anything!





1. (2 pts) NAME AND EMAIL ADDRESS:
YOUR ID: ID TO RIGHT: ROW: NO. FROM RIGHT:
The exam will begin on the next page. Please, do not turn the page until told.
This page summarizes the points available for each question so you can plan your time.
1. (2 pts) Name and email address. 2. (5 pts total) Probability and Bayes Rule. 3. (5 pts total) Decision Tree Learning. 4. (18 pts total, 3 pts each) Linear Classifier (Perceptron) Learning. 5. (10 pts total, 2 pts each) Unification. 6. (10 pts total) Naïve Bayes Classifier Learning. 7. (10 pts total) Propositional Logic and Resolution Proof. 8. (16 pts total, 2 pt each) Machine Learning. 9. (4 pts total, 1 pt each) Linear classifier (perceptron) learning. 10. (5 pts total, -1 for each wrong answer, but not negative) Alpha-Beta Pruning. 11. (15 pts total, 3 pts each) Tree Search.
4. (18 pts total, 3 pts each) Linear Classifier (Perceptron) Learning. Label the following as Y (= yes) or N (= no) depending on whether a perceptron with a “hard” decision boundary (step transfer function) can correctly classify the examples shown. If your answer is Y (= yes), fill in a set of weights that correctly classifies them. Use w0 as the threshold and wi as the weight for input xi. All perceptrons have three Boolean inputs, x1, x2, and x3, and a “dummy” input, x0, which is always equal to one. They all compute the decision function ∑ wi xi > 0. You may not transform the input space, i.e., they operate on the stated inputs.
4a. (3 pts) “At least two inputs are 1.” Correctly classifiable? If yes, weights are w0 = ; w1 = ; w2 = ; w3 =
4b. (3 pts) “Exactly two inputs are 1.” Correctly classifiable? If yes, weights are w0 = ; w1 = ; w2 = ; w3 =
4c. (3 pts) “At most two inputs are 1.” Correctly classifiable? If yes, weights are w0 = ; w1 = ; w2 = ; w3 =
4d. (3 pts) “Input x1 = 1, input x2 = 0, input x3 =anything.” Correctly classifiable? If yes, weights are w0 = ; w1 = ; w2 = ; w3 =
4e. (3 pts) “IF input x1 = 1 THEN input x2 = 0 ELSE input x2 = 1.” Correctly classifiable? If yes, weights are w0 = ; w1 = ; w2 = ; w3 =
4f. (3 pts) “Input x1 = input x2.” Correctly classifiable? If yes, weights are w0 = ; w1 = ; w2 = ; w3 =
5. (10 pts total, 2 pts each) Unification. For each pair of terms, write the most general unifier, or “None” if none exists. Write the unifier as a list of variable/value substitutions.
5.a. Likes(x, y); Likes(John, Mary)
5.b. Knows(John, x); Knows(y, Mother(y) )
5.c. Faster(y, G(y) ), Faster(John, Mary)
5.d. Faster(x, y), Faster( G(y, John), H(Mary) )
5.e. Likes(x, F(x) ), Likes( F(z), z)
6. (10 pts total) Naïve Bayes Classifier Learning. You must make a Naïve Bayes classifier that will discriminate Oak from Pine. You are given the following examples:
6a. (2 pts) Apply Baye’s rule to rewrite the conditional probability of the class given the attributes as the conditional probability of the attributes given the class (“^” means AND). Give a mathematically exact formula (i.e., do not yet assume independence). You may use the customary convention that is a normalizing constant.
P(Class | Density ^ Grain ^ Hardness) =
6b. (2 pts) Now assume that the attributes (Density, Grain, and Hardness) are conditionally independent given the Class. Rewrite your expression for 6a, above, under this assumption of conditional independence. I.e., rewrite it as a Naïve Bayes Classifier expression). You may use the customary convention that is a normalizing constant.
P(Class | Density ^ Grain ^ Hardness) =
6c. (4 pts total; -1 for each wrong answer, but not negative) Fill in numerical values for the following expressions. Leave your answers as common fractions (e.g., 1/4, 3/5). (You do not need a calculator; the numbers have been chosen to be easily solved.)
P(Oak)= P(Pine)=
P(Density=Light | Class=Oak)= P(Density=Light | Class=Pine)=
P(Density=Heavy | Class=Oak)= P(Density=Heavy | Class=Pine)=
P(Grain=Small | Class=Oak)= P(Grain=Small | Class=Pine)=
P(Grain=Large | Class=Oak)= P(Grain=Large | Class=Pine)=
P(Hardness=Hard | Class=Oak)= P(Hardness=Hard | Class=Pine)=
P(Hardness=Soft | Class=Oak)= P(Hardness=Soft | Class=Pine)=
6d. (2 pt) Classify a new example (Density=Heavy ^ Grain=Small ^ Hardness=Hard).
P(Class=Oak | Density=Heavy ^ Grain=Small ^ Hardness=Hard) =
P(Class=Pine | Density=Heavy ^ Grain=Small ^ Hardness=Hard) =
Example Density Grain Hardness Class Example #1 Light Small Hard Oak Example #2 Heavy Large Hard Oak Example #3 Heavy Small Soft Oak Example #4 Light Large Hard Pine Example #5 Light Small Soft Pine Example #6 Heavy Large Soft Pine
8. (16 pts total, 2 pt each) Machine Learning. Label the statements T (true) or F (false).
8a. A linear classifier (perceptron) can learn and represent any Boolean function.
8b. A decision tree can learn and represent any Boolean function.
8c. A Naïve Bayes classifier can learn and represent only axis-parallel classes.
8d. “Naive Bayes” is called “naive” because only naive people ever use it.
8e. Overfitting is a general phenomenon that occurs with all types of learners.
8f. The information gain from an attribute A is how much classifier accuracy improves when attribute A is added to the example feature vectors in the training set.
8g. An agent is learning if it improves its performance on future tasks after making observations about the world.
8h. Cross-validation is a way to improve the accuracy of a learned hypothesis by reducing over-fitting using Ockham’s razor.
9. (4 pts total, 1 pt each) Linear classifier (perceptron) learning. Label the statements Y (yes) or N (no).
9a. Suppose that you are given two weight vectors for a perceptron. Both vectors, w1 and w2, correctly recognize a particular class of examples. Does the vector w3 = w1 − w2 ALWAYS correctly recognize that same class?
9b. Does the vector w4 = w1 + w2 ALWAYS correctly recognize that same class?
9c. Does the vector w5 = cw1 where c = 42 ALWAYS correctly recognize that same class?
9e. Suppose that you are given two examples of the same class A, x1 and x2, where x1 ≠ x2. Suppose the example x3 = 0.5x1 + 0.5x2 is of a different class B. Is there ANY perceptron that can classify x1 and x2 into class A and x3 into class B?
10. (5 pts total, -1 for each wrong answer, but not negative) Alpha-Beta Pruning. This game tree illustrates a position reached in the game. It is MAX's turn to move. Cross out each leaf node that will be pruned when using alpha-beta pruning. 11. (15 pts total, 3 pts each) Tree Search. Use the tree below to indicate the order that nodes are expanded, for different types of search. Assume that A is the start node and G (double box) is the only goal node. Costs are shown to the right of each path, g = cost of path so far, h = estimate of remaining cost to goal, f = estimate of total path cost.
11a. Uniform-cost search.
11b. Iterative deepening depth-first search.
11c. Greedy best-first search.
11d. A search.*
11e. Is the heuristic h admissible? (Y or N)
g= h= A f= 25
5 45
F
g= h= f=
G
g= h= f=
C
g= h= f=
80
10 5
D
g= h= f=
E
g= h= f=
B
g= h= f=