Point classification

Error : 0.00
Gen : 1

How does it work ?

Machine learning is the study of computer algorithms that improves automatically through experience.

In this case the it is used to separate various points plotted in a region by color.
Question remains, how does this example works ?

It's as follows :


Step 1 :

step 1

Initially a circle is drawn, this is the region were the machine will operate.
Later few ( n = 250) points are randomly drawn on the region. The number n is arbitrary and it doesn't affect the results.
The location of these points is stored in a array to later feed to the learning algorithm (Let's call it ml for now).


Step 2 :

step 2

A line is randomly draw, let's call it pseudo line and make all the points that are 'left' of it Red and all the points on it's 'right' blue or vice-versa.
Later, this line is discarded and the only thing left is the position and the color of the points present.


Step 3 :

step 3

Once the required points are plotted the pseudo line is removed from the region and only the colored points are left. Now it's up to the ml to draw a line and adjust it in such a way that all the colored pointes are separated.


Step 4 :

step 4

The ml first draws a random line called 'ml_line' (green in color), this line is not related to the previous pseudo line and only has information about the points and their respective color.

So how does the machine train ?

For the ml_line, let's pre-decide that we want all red points on the left and blue on the right or vice-versa.

Next ml will check all the present line.
If they are as we decided then it is ignored and if not then it's distance is calculated and stored in a variable called 'ml_error'
Now we have the distances of all the misplaced points as error, ml will now adjust the line by checking all the possible cases by which it can move the line and the one that will produce the least error will be executed.


Step 5 :

step 5

Once all the points are evaluated and the ml_line is moved, if the error is low enough to be ignored the work is done else the no. of generation is increased by one and the process repeats.

And finally the task is complete, thus rather than having to find a rigid formula or method by hand to find a method to separate these points by color, we wrote a algorithm that will teach itself to do the specific task by trial and error.

And that's the rudimentary concept of Machine Learning.

Hence my first Machine Learning project is completed ! :)