clear all;
close all;

# Testing data set
x1=[2 2.5];
x2=[2 9.5];

# Actual labels
yy=[-1 1];

# Standardized
s1=(x1-mean(x1))./std(x1);
s2=(x2-mean(x2))./std(x2);

figure;plot(s1,s2,.);axis([-2 2 -2 2]);grid on;

# Use the good parameter values obtained in training
w1=1.5;
w2=1;
gm=0.5;

# Calculate the model
ws1=w1*s1;
ws2=w2*s2;

# Predict the labels
err=ws2-(ws1+gm);
sign(err)

#Predicted labels are [-1 -1], but actual labels are [1 -1]
# Therefore if we call 1 as true and -1 as false, and sub domain
# where the 1 is positive domain and the sub domain where the -1
# is negative domain then in the prediction the true (1) value is
# predicted in negative sub domain -1 true negative is detected

hold on;plot(-2:2,1.5*(-2:2)+0.5);