4.11 HW Machine Learning SOLUTION
4.11 HW Machine Learning SOLUTION
4.11 HW Machine Learning SOLUTION
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
Q3: Draw a clearly labelled neural network and its structures that represents the automated seat belt fastener
alert decision.
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