What is Machine Learning?

What is Machine Learning?

“Machine Learning!”

As a buzz word “machine learning” is all the rage. VCs open their pocketbooks at the mere mention of the phrase. The phrase conjures immediate images of Star Trek’s Data or deadly Terminators. But what is Machine Learning (and its parent, Artificial Intelligence) really and how can it actually help your business?

In this post I’m going to give you the simplest possible example of machine learning / artificial intelligence that will allow you to grasp the basics with ease.


Machine Learning vs Artificial Intelligence

First, it might be helpful to note what the difference is between “Machine Learning” and “Artificial Intelligence.” As the image below shows, Machine Learning is a kind of Artificial Intelligence, but not all Artificial Intelligence is necessarily Machine Learning.

Diagram showing Machine Learning is a subset of Artificial Intelligence

So, what’s the difference? Machine Learning is the subset of Artificial Intelligence that involves learning from data rather than merely solving some specific problem. For example, let’s say you want to write an artificial intelligence program to move a unit in War Craft from one location (where it currently is) to a new location (where the player clicked the mouse) that doesn’t require learning anything from data. You just search for the shortest path, given any obstacles present, between two points.

Let’s say instead you want to write a face recognition program, but it’s not at all clear how to do that. Do you look for the presence of eyes? What defines what counts as an ‘eye’? What if the person’s face is just a profile? What then? Since it is not obvious how to write such a program, we’d instead use machine learning and throw many examples of images of face at it until it learned how to tell what did vs did not count as a face.


How Does Machine Learning Work?

From the way people talk about machine learning today, it is often treated like some form of magic. But what machine learning really does is work out statistical correlations. The simplest form of machine learning is a very old statistical trick called ‘linear regression.’ In it you simply fit a line to the data and then (hopefully) use the line to predict data points you’ve not seen yet. Let’s try a very simple example to illustrate.


Linear Regression

Suppose we have a dataset that consists of homes sold and how many square feet the home was.

+----------+-------------+-----------------+
| House ID | Square Feet | Sales Price ($) |
+----------+-------------+-----------------+
|    1     |     1500    |      197536     |
|    2     |     1800    |      260942     |
|    3     |     2000    |      282367     |
|    4     |     1400    |      169856     |
|    5     |     2200    |      323267     |
|    6     |     1600    |      199154     |
|    7     |     2500    |      363821     |
|    8     |     1900    |      285262     |
|    9     |     2100    |      280425     |
|    10    |     2300    |      326080     |
+----------+-------------+-----------------+

We can visualize these data as a simple graph:

A scatter plot chart showing sales price to square feet, as the price increases so does the square feet

Let’s say you wanted to sell your house and you wanted to predict what the sales price would be. How might you do that? One idea that comes to mind is to fit a line to that graph as an average.

The same scatter plot chart as before, but now a linear line identifies the mean or average of the increase

Now that we have this line, let’s say we want to sell a house for 1700 square feet. What price should we predict? The line now gives us an answer: $229,332.73

The same scatter plot chart as before, but now showing a new predicted point on the linear line

This linear regression is the simplest form of machine learning. It takes in sample data – in this case the square feet of houses that sold compared to their sales price – and it forms a ‘model’ (nothing more than a simple line in this case) of what to expect in the future.


Hyper Dimensional Planes

Now you might have scoffed at that graph and thought in your mind “Oh, come on! You can’t really predict a house based only on its square feet! I mean what if the house is in New Mexico vs California?”

This is indeed a problem! Square feet is a factor in the cost of a house but not as much as, say, its location. Ideally, you’d want your model to take into consideration several different factors at once including maybe location, # of bedrooms, size of the lot, age of the house, etc. But obviously you can’t ‘fit a line’ to that much data because we’re no longer talking about a simple 2-D graph!

It turns out that mathematically ‘fitting a line’ is no different than ‘fitting a plane’. So, imagine we trained our model off of both square feet and # of bedrooms. We could then fit a plane to it to make our predictions:

A three dimensional version of the scatter plot chart shown before, now with the dimension of bedrooms included

Okay, so what if we decide to add in location and have a 3rd parameter. Now we have 3 input parameters and one output, so we need four dimensions to visual this!

While you can’t easily visualize it, the computer has no problem. It just fits a ‘hyper plan’ with 3 dimensions (in this case equivalent to a box) and makes predictions based on that. You can keep adding as many dimensions as you want, and the computer will just fit a ‘hyper plane’ of more and more dimensions. Even though you can’t imagine it in your head, mathematically there is nothing difficult about doing this.


Can We Get Fancier?

So, if we can fit hyper planes to make predictions, can we do fancier stuff? That is probably a topic for another blog post, but the short answer is ‘yes’. Machine Learning is all about utilizing various kinds of fancy ways to improve the predictions. Maybe we could fit a curve instead of a line? Or even fit a circle? No problem!


Is It Magic?

Okay, now that you understand what machine learning is doing, it should be pretty obvious that it is not magic. It’s just mathematically fitting a model of some sort to your data and then using it to predict something that hasn’t been seen before. It isn’t going to magically turn into a Terminator. It’s just a tool that is quite useful for making predictions.

What kinds of predictions? I’ll save that for a future blog post.

In the meantime, if you are interested in how AI/ML can benefit your company or organization, please do reach out through our contact-us page! We are always happy to work with anyone looking to improve their software and technology, and our team of experts and talented software engineers are ready to tackle any project.

Contact Us: LINK

SHARE


comments powered by Disqus

Follow Us

Latest Posts

subscribe to our newsletter