Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

4.11 HW Machine Learning SOLUTION

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

4.

11 HW Machine Learning SOLUTIONS


Q1: Discuss and demonstrate in detail how an accurate classifier can be found for the following training data
shown in 2D.
Many possible kernel transformations can be
done, this one below is from the LMS x y z=x+y2 shape
4 2 8 triangle
1 3 10 triangle
3 3 12 triangle
6 3 15 triangle
8 4 24 triangle
2 5 27 triangle
4 5 29 circle
6 5 31 circle
4 6 40 circle
6 7 55 circle

z=(x-5)2+(y-6)2 will also work as a kernel


transformation for this dataset x y z=(x-5)2+(y-6)2 shape
where z > 6 forms a hyperplane separator which 4 2 17 triangle
1 3 25 triangle
is a plane.
3 3 13 triangle
6 3 10 triangle
8 4 13 triangle
2 5 10 triangle
4 5 2 circle
6 5 2 circle
4 6 1 circle
6 7 2 circle

The data is not linearly separable so a perceptron is not suitable for classification in this case. An SVM can be used
and a transformation function (kernel) can be applied to the data for example z=x+y2 then a linear classifier can be
applied in the transformed space, this will result in a decision boundary hyperplane in 3D for example z > 28 are
circles. (NOTE: Other valid kernel transformations may exist)

Q2: The Abacus company came up with the following hyperplane as shown in the diagram below. What are the
issues with the result?
If the training data was sufficient and representational then underfitting has
occurred on the training data as the hyperplane boundary is not classifying
correctly and it is unlikely that the predictions on new data will be correct.
There may not have been enough training data, or it may not have been
representational of the population to determine, there may be outliers that
are misclassified.

Consider the following table for an automated seat belt fastener alert in a car which is making decisions based on a
function in a single hidden neuron that accepts weighted input from two binary sensor inputs and a conditional
function applied to them.
Input1 =(weight sensor on seat > 1kg) Input2= (seatbelt on for seat) Show Alert =
X1 X2 NOT(NOT(Input1) OR (Input2))
0 0 0
0 1 0
1 0 1
1 1 0

CHES Algorithmics Unit 4


4.11 HW Machine Learning SOLUTIONS

Q3: Draw a clearly labelled neural network and its structures that represents the automated seat belt fastener
alert decision.

Show input, hidden and output layers

The inputs and their alert outcomes for the seat belt alert mechanism can also be shown on a cartesian plane below.

Q4: Can this seat belt alert be represented by a perceptron neural network and/or a support vector machine or
both? Explain your answer.
• The inputs and their results are linearly separable when plotted on a cartesian plane so can be decided using a
support vector machine. The SVM classifier would be a hyperplane that separates the Nos and Yesses with the
biggest margin possible.
• The inputs and their results are linearly separable as the output of the function in the hidden layer is
true/false and can also be represented by a perceptron neural network.
• Since the only data points possible for this scenario are Boolean values (0,1), (0,0), (1,1) and (1,0) a
deterministic algorithm can easily determine the seat belt alert.
If (NOT(NOT(Input1) OR (Input2))) then
Show alert
End if

Q5: If you answered yes to any of the previous then show the classifiers for each Machine Learning method(s).
• Perceptron Neural Network Binary classify O=( true if w1x1 + w2x2 > 0, false if w1x1 + w2x2=0)
• SVM hyperplane to classify the two types of output with the biggest margin possible would go through the
cartesian points (0.5,0) and (1,0.5)
Hyperplane gradient=1 w1(0.5)1-w1(0)-b=0
Weight vector gradient = -1 w1(0)-w1(0)-b=-1  b=1
hence w1=-w2 -w1=w2 w1(1)-w1(0)-b=+1  w1=2
w1x1+w2x2-b=0 on hyperplane w2=-2
w1x1+w2x2-b=-1 for (0,0),(1,1)
w1x1+w2x2-b=1 for (1,0) 2x1-2x2-1=0 defines
hyperplane for SVM

CHES Algorithmics Unit 4

You might also like