In this article, we will study what are the positive and negative regions of the line, and how the line changes with changes in the coefficients. Finally, we will see how to make transformations such that the point is correctly classified in the region of the line.
Positive & Negative Region
Let's understand it quickly by looking at the following picture. The green region shows the positive region of the line while the blue region is negative.
You can identify if the point is in positive or negative region by substituting the data point in the equation. For example, your equation is,
$$2x+y-15=0$$
and suppose your data point is (9,6). You must substitute the coordinates of data point, i.e., x and y in the line equation. Therefore, we get,
$$2(9)+(6)-15 = 9$$
Since 9 is greater than 0, the point is in the positive region of the line. But if the data point was (4, 2) we will get.
$$2(4)+(2)-15 = -5$$
It is less than 0, therefore it is in the negative region of the line.
Changing Coefficients
Let's say we represent the equation generally as given below:
$$Ax+By+C=0$$
Changing A
If we keep B and C coefficients constant and change A, then we can see results given below. The line rotates about the y-axis. Thus, we initially start with A=2, but when we make A=4, the line rotate towards right. When we make A=-2, we get the green line.
Changing B
Similar to changes in A, you can see that changing the B coefficient makes the line rotate on the x-axis.
Changing C
When you change C, you can move up and down the y-axis.
Transformations on the line
-ve region, we will add
+ve region, we will subtract
CASE 1: Point lies in the positive region but we want it in negative region
In the above figure, equation of line is ,
$$2x+3y\ +5\ =0$$
Let's assume that data point (4,5) is misclassified and it must lie in the negative region of line. We must change the coefficients in such a way that all the points become correctly classified.
Consider data point (4, 5) first and follow the steps given below.
Add 1 to the point and make it (4, 5, 1)
Subtract the above point from the coefficient of line(2, 3, 5)
i.e.
$$\begin{array}{llll} \hspace{1.5cm} 2\hspace{1cm}3\hspace{1cm}5 \\ - \hspace{1cm} 4\hspace{1cm}5\hspace{1cm}1 \\ ---------\\ \hspace{1cm} -2\hspace{0.5cm}-2\hspace{0.7cm}4 \\ \end{array}$$
Thus, the new line has the equation,
$$-2x-2y\ +4\ =0$$
Thus, now the given point is correctly classified
CASE 2: Point lies in negative region and we want it in positive region.
In the above picture, the point (-7,-4) lies in the negative region of the line. Follow the steps given below to bring it in the positive region of the line by applying the transformation.
Add 1 to the coordinate of the point, thus it becomes (-7, -4, 1)
Now, add this to the coefficients of the line, i.e., (2, 3, 5)
$$\begin{array}{llll} \hspace{2.2cm} 2\hspace{1.4cm}3\hspace{1cm}5 \\ + \hspace{1cm} -7\hspace{0.5cm}-4\hspace{1cm}1 \\ ---------\\ \hspace{1.8cm} -5\hspace{0.5cm}-1\hspace{1cm}6 \\ \end{array}$$
Thus, the new line has the equation,
$$-5x-1y\ +6\ =0$$
Thus, now the given point is correctly classified