Saturday, 10 May 2014

For those 80% who were failing in test



Prediction

Today someone posed a question claiming that 80% people are failing in this test.
It must be a difficult question as 80% is quiet a big number. The question was as follows:



10291099_754095931298970_3192310435846657983_n.jpg


So i thought of starting this blog to answer such questions in a different way so that people can visualize the solution from my point of view. Hope it will help to see the problem differently.

Let us see how a dumb machine can answer it intelligently. If a dumb machine will be able to answer i hope we all will answer in a better way. 

Let us see it as a machine learning problem. 

We are given 6 instances in (x,y) form that is {(1,11),(2,22),(3,33),(4,44),(5,55),(6,66)}

So the training data is {(1,11),(2,22),(3,33),(4,44),(5,55),(6,66)}

now we want to find the value of y when x is given as 11.

Clearly we want to predict something new. Prediction problems are those where we are given with some knowledge and asked to answer some new question which was not known earlier. We have seen many such examples in our real life. In childhood you might have seen your grandmother predicting that it is going to rain today, with the help of her past experiences. This form of learning is called supervised learning in machine learning text. Where the dumb robot learns from the examples.



Let us visualize the given two dimensional data first. We will plot the points in 2D space to see if there is some relation between the points?




We can clearly see these points are showing some kind of linear relationship. Hmm i must try to fit a line over these points and see what is the error rate?

Beautiful, This line is fitting accurately,
Line with slope 11 and intercept 0 fits the given data. correlation coefficient is 1 and Residual Sum of Square is 0. That means the estimated function is well sited. 

Now once the function is estimated we can predict any y value for a given x value. Out prediction function says that the value of y is linearly dependent on x.  

y=11x+0 is the fitting line.

Now we want to find the value of y for x=11.
So just place the value of x in the formula of line and find the answer.

y=11*11=121.

I hope you will have few doubts as i have not explained some of the portion. It is just to know how many are reading attentively. Please comment below the doubts so that i can explain the questions in a new blog post on those questions.