Docsity

CS 791A Machine Learning Homework 2, Assignments of Computer Science

Toggle sidebar
bg1
Homework 2
CS 791A - Machine Learning
Instructor: Dr. Arun Ross
Due Date: Nov 30, 2007 (11:59pm)
Note: You are permitted to discuss the following questions with others in the class.
However, you must write up your own solutions to these questions. Any indication to the
contrary will be considered an act of academic dishonesty.
1. (a) [15 points] Sketch decision trees to represent the following boolean functions: (i) A ∧
B’; (ii) A ∨[A ∧C]; (iii) A xor B.
(b) [10 points] The Gini Index,G, can be used a measure of impurity when constructing
decision trees. For an arbitrary problem with multiple output categories, Gcan be
written as follows:
G=X
i6=j
p(i)p(j),
where p(i) represents the probability of observing a training sample from output class
i. Thus, for a certain attribute A, the Gini Index G(A) can be expressed as,
G(A) = X
v∈A
p(v)X
i6=j
p(i|v)p(j|v).
Based on the Gini Index, determine which attribute will be selected as the topmost
node based on the training samples in Table 3.2 of the ML textbbook (page 59).
2. [20 points] Consider a learning problem involving two attributes (x1and x2) and two output
categories (c= 0 or 1). Use the gradient descent algorithm to determine the weights (w0,w1,
w2) of a single-layer perceptron defined by the threshold expression w0+w1x1+w2x2= 0.
Assume that the learning rate, η, is 0.1. The training samples for determining the weights
are listed below.
pf2

Partial preview of the text

Download CS 791A Machine Learning Homework 2 and more Assignments Computer Science in PDF only on Docsity!

Homework 2

CS 791A - Machine Learning Instructor: Dr. Arun Ross Due Date: Nov 30, 2007 (11:59pm)

Note: You are permitted to discuss the following questions with others in the class. However, you must write up your own solutions to these questions. Any indication to the contrary will be considered an act of academic dishonesty.

  1. (a) [15 points] Sketch decision trees to represent the following boolean functions: (i) A ∧ B’; (ii) A ∨ [A ∧ C]; (iii) A xor B. (b) [10 points] The Gini Index, G, can be used a measure of impurity when constructing decision trees. For an arbitrary problem with multiple output categories, G can be written as follows: G =

i 6 =j

p(i)p(j),

where p(i) represents the probability of observing a training sample from output class i. Thus, for a certain attribute A, the Gini Index G(A) can be expressed as,

G(A) =

v∈A

p(v)

i 6 =j

p(i|v)p(j|v).

Based on the Gini Index, determine which attribute will be selected as the topmost node based on the training samples in Table 3.2 of the ML textbbook (page 59).

  1. [20 points] Consider a learning problem involving two attributes (x 1 and x 2 ) and two output categories (c = 0 or 1). Use the gradient descent algorithm to determine the weights (w 0 , w 1 , w 2 ) of a single-layer perceptron defined by the threshold expression w 0 + w 1 x 1 + w 2 x 2 = 0. Assume that the learning rate, η, is 0.1. The training samples for determining the weights are listed below.

a 1 a 2 c 0.1 1.1 0 6.8 7.1 0 -3.5 -4.1 0 2.0 2.7 0 4.1 2.8 0 3.1 5.0 0 -0.8 -1.3 0 0.9 1.2 0 5.0 6.4 0 3.9 4.0 0 7.1 4.2 1 -1.4 -4.3 1 4.5 0.0 1 6.3 1.6 1 4.2 1.9 1 1.4 -3.2 1 2.4 -4.0 1 2.5 -6.1 1 8.4 3.7 1 4.1 -2.2 1

Consider two sets of initial weights: (a) w 1 = w 2 = w 3 = 0, and (b) w 1 = w 2 = w 3 = 1. For each case: (a) observe the linear boundary at the end of each iteration with respect to the two categories of training samples; (b) show the final decision boundary along with the associated set of weights; and (c) note the number of iterations required for convergence.

  1. [10 points] Exercise 9.4 in the ML textbook. Also state what would be an appropriate fitness function for this problem?
  2. [10 points] What is the multi-armed bandit problem? How can this problem be incorporated in a Q-learning framework?