Professional Documents
Culture Documents
Question 1
A farmer needs to decide whether or not to grow sweetcorn next year. He has
a table of data based on the experience of eight other farmers showing
attributes for climate, soil type and market demand, along with the outcome:
whether or not the crop was profitable.
He has determined that the attribute values for next year are: {Warm, Acid,
Medium}.
(a) Use 1R to derive a set of rules from the above data. Explain all the steps
you follow and show your calculations.
(b) According to your 1R rules should he grow sweetcorn next year?
(c) Use Naïve Bayes to derive the probabilities about growing sweetcorn
being profitable or not. Show all your computations.
(d) Use the ID3 algorithm to derive a decision tree from the above data. Show
all your calculations.
(e) According to your decision tree will growing sweetcorn be profitable or
not?
(f) Use the PRISM algorithm to derive a set of rules from the above data.
Explain all the steps you follow and show your calculations.
(g) According to the rules generated by PRISM will growing sweetcorn be
profitable or not?
(h) Transform your decision tree from (d) to rules and compare them to the
ones generated by PRISM. What do you think is the reason for the
difference between them? Is there some instance for which the two rule
sets will disagree?
(i) Which of these four algorithms would you say is the least suitable for this
problem? Why?
Page 1 of 2
Question 2 - Optional
(a) Consider a two input linear model with inputs x1 and x2, whose decision
surface crosses the x1 axis at 5 and the x2 axis at -1. If the bias weight of
this model is w0 = 0.5, what are the values of its other two weights (w1 and
w2)?
(b) A 2-input perceprton is initialised with the weights w0 = -0.1, w1 = 0.3, and
w2 = 0.05. Carry out the Perceptron Algorithm once on the following set of
examples. For each example calculate the prediction made by the
perceptron and the corresponding weight update. Show all your
calculations.
x1 x2 Class
2 1 -1
0 3 -1
3 -1 -1
0 -1 1
-4 -4 1
x1 x2 x3 x4 x5 class
1 0 1 1 -2 1
0 0 -1 -1 1 0
1 -1 1 1 2 1
-2 0 0 0 0 0
1 0 0 3 -1 1
Page 2 of 2