Machine Learning in 500 words
Machine learning is without a doubt a very trendy topic nowadays and it is expected to remain a topic of interest for the next couple of years, almost everything you do online is controlled by some machine learning algorithm hosted on some server, whether you are browsing Facebook, Instagram or even LinkedIn, you contribute to the learning process of the machine learning algorithm by providing your data, but what is exactly machine learning? Is it some sort of a magical box that we can use to engineer extraordinary stuff?
Not really, Tom Mitchell, a computer scientist describes machine learning as the study of computer algorithms that allow computer programs to automatically improve through experience. Or in simpler words, it is the art and science of teaching the dumbest machine that ever existed (the computer) to make decisions as simple as telling the difference between a cat and a dog or as complicated as detecting fraudulent bank transactions.
There are different machine learning algorithms out there, each have its own usage, to name a few:
- 1) Linear Regression
- 2) Logistic Regression
- 3) Neural Network
- 4) Decision Tree
- 5) KNN (K-Nearest Neighbors)
And many more, but for the sake of this article and to not confuse you, we will focus on simple linear regression.
Imagine you have a table with two columns, house price and house size and your goal is to predict the price of a house, given the data in the table below.
Plot the values of your table on a scatter plot like the image below:
Within this plot, we need to find the best fit line, and to do this, we would either use y = mx+c or y = theta0 + theta1 * x.
For now, let us use y = mx + c. Now in this equation we have two variables that we need to find before proceeding, m and c, finding them is straight forward, we would calculate M using the formula below:
M = ∑(x-x' )(y-y' )/(x-x')^2
Whereby the numerator is obtained by multiplying the product of subtracting each value of x from the average of x by the product of subtracting each value of y from the average value of y. As for the denominator, the value is obtained by squaring the value of (X-X’).
∴y=mx+c 3100=0.14*320+c c=3100-44.8
c=3055.2
Since we have both the variable M and C, we can now draw the best fit line through the scattered plot and predict the value of y by providing x. To find the best fit line where the distance between the plotted values and predicted values are small, the algorithm will continue to adjust itself by basically changing the value of M through multiple iterations until it finds the smallest possible distance between the line and the given data.
The explanation above is incredibly simplified, keep in mind that machine learning algorithms do get much more complicated than what you read now but no matter how good your algorithm is, it all depends on the data you use to teach it.
Its amazing the way you broke it down and made it as simple as it could be 👏 .
You gonna follow up for the other 4 as well? 🤩