Many people see machine learning as a path to artificial intelligence (AI). But for a data scientist, statistician, or business user, machine learning can also be a powerful tool for making highly accurate and actionable predictions about your products, customers, marketing efforts, or any number of other applications.

Even if you are not technically prepared to create machine learning algorithms, it doesn’t mean you cannot leverage the power of machine learning. The first step to implementing machine learning in your line of work is to understand why it is valuable. From there, it’s just a matter of training and iterating until you achieve your desired results.

Machine Learning vs. Artificial Intelligence: What’s the Difference?

Everyone knows about AI. Usually, when we hear that term, we picture robots that can perform human tasks better than we can. However, we’re still a very long way from building robots that will replace us; many of the activities you do every day are surprisingly complex. So while much of the potential of AI still remains unrealized, machine learning is very real and already here.

Machine learning can be considered a part of AI, as most of what we imagine when we think about AI is machine-learning based. Machine learning is, at its core, the process of granting a machine or model access to data and letting it learn for itself.  

This idea is relatively new. In the past, we believed robots would need to learn everything from us. But the human brain is sophisticated; not all of the actions and activities it coordinates can be easily described. In 1959, Arthur Samuel came up with the brilliant idea that we shouldn’t have to teach computers, but rather, we could let them learn on their own. He coined the term “machine learning” to describe his theory, which is now a standard definition for the ability of computers to learn autonomously.

Common Machine Learning Applications

The best way to understand the potential of machine learning is to explore how people and companies are currently taking advantage of it. Let’s consider a few examples:

Natural language processing: If you think Google Translate is just a really good dictionary, think again. It’s actually created from a set of machine learning algorithms that updates the service over time based on input from users, like new words and syntax. Siri, Alexa, Cortana, and, most recently, Google Assistant all rely on natural language processing to recognize speech and synthesis, allowing them to understand or pronounce words they have never encountered before.

ML4.png

Recommendation systems: On Netflix, Amazon, and Facebook, everything that is recommended to you depends on your search activity, likes, and previous behavior. These websites deliver recommendations across platforms, devices, and apps. Machines match sellers with buyers, movies with prospective viewers, photos with people who want to see them — all of which improves our lives and online experiences significantly.

ML5.png

Amazon has such amazing machine learning algorithms in place that it can predict with high certainty what you’ll buy and when you’ll buy it. The company even owns a patent for “anticipatory shipping,” a system that ships a product to the nearest warehouse so you can order and receive your item on the same day (although it’s unclear whether they’ve implemented it yet).

Algorithmic trading: Algorithmic trading is a process that involves random behavior, ever-changing data, and a variety of factors — from political to judicial — that are far away from traditional finance. While financiers cannot predict much of that behavior, machine learning algorithms can — and they respond to changes in the market much faster than a human.  

ML7.png

There are plenty of other business implementations of machine learning. You can predict if an employee will stay with your company or leave. You can decide if a customer is worth your time, if they’ll likely buy from a competitor, or not buy at all. You can optimize processes, predict sales, and discover hidden opportunities.

Then we have autonomous vehicles. What was once merely a vision of science fiction is now a reality; millions of miles have already been driven by cars that don’t require a human operator. This, once again, originated from a set of machine learning algorithms that enabled cars to learn how to drive safely and effectively.

ML8.png

As you can see, machine learning opens a whole world of opportunities — a dream come true for those involved in a corporation’s ongoing strategy.

So How Do You Create a Machine Learning Algorithm?

Creating a machine learning algorithm ultimately means building a model that outputs correct information given that we’ve provided input data. You can think of a model as a black box: inputs go in and outputs come out — but the processes in between are fairly complex. For instance, if we want to create a model that predicts the weather tomorrow based on meteorological information from the past few days, we would feed the model metrics such as temperature, humidity, and precipitation. The output would be the weather forecast for tomorrow.

ML9.png

But we can’t just assume the model is accurate. First, we must train the model. Training is a key concept in machine learning; it’s the process through which a model learns how to make sense of input data.

Training a Machine Learning Model

Not every machine learning model uses the same techniques, so training will depend on your approach. Below, we’ll explore model training that relates to a neural network in the context of supervised learning. Neural networks are a family of machine learning algorithms that get their name from the fact that they were meant to simulate the neurons in the human brain (that’s not exactly the case in reality, but the name has stuck).

Neural networks have a constantly growing number of branches and are used for a variety of tasks, like natural language processing, computer vision, etc. Most state-of-the-art machine learning is based on neural networks.

In order to train a neural network, you’ll have to consider four main ingredients: the data, the model, the objective function, and an optimization algorithm.

1. Data

First, we must prepare a certain amount of data to train on. Usually, this is historical data, which is often readily available.

2. Model

Second, we need a model. The simplest model we can train is a linear model. In my weather forecast example, that would mean we would need to find some coefficients, multiply each variable by those coefficients, and take the sum of everything to get the output.

A linear model is just the tip of the iceberg, though. Deep learning lets us create complicated non-linear models. They usually fit the data much better than a simple linear relationship.

ML10.png

3. Objective function

The third ingredient is the objective function. After feeding the data to the model, we want to obtain an output that is as close to reality as possible. That’s where the objective function comes in.

The objective function allows you to estimate how accurate the model’s outputs are, on average. The entire machine learning framework boils down to optimizing this function. For example, if our function is measuring the prediction error of the model, we would want to minimize this error or, in other words, minimize the objective function.

ML11.png

4. Optimization algorithm

The final ingredient is the optimization algorithm, or the mechanics through which we vary the parameters of the model in order to optimize the objective function. For instance, if the weather forecast model is:

Weather tomorrow equals w₁temperature + w₂humidity, the optimization algorithm may go through values like:

W1 = 1.05, W2 = 1.2;

W1 = 1.05, W2 = - 1.2;

W1 = 1.04, W2 = - 1.19

W1 and W2 are the parameters that will change. For each set of parameters, we would calculate the objective function. Then, we would choose the model with the highest predictive power — the one with an optimal objective function.

ML12.png

Machine Learning is Iterative

I called our model training stages “ingredients” rather than “steps” because the machine learning process is iterative. You wouldn’t just stop training after your first attempt at optimizing the objective function. Instead, you would vary the model’s parameters and repeat the operation until you couldn’t optimize the objective function any further.  

These are the pillars on which neural networks stand. Each of the four ingredients must be explored individually in order to actually build an accurate machine learning algorithm, but as you can see, the fundamental logic is far from difficult. So what are you waiting for? Try applying machine learning to your everyday tasks — you might be surprised by how quickly they improve.

This piece was adapted with permission of the author from a post that originally appeared on 365 Data Science. 

Iliya Valchanov
Author
Iliya Valchanov

Iliya is a Finance graduate with a strong quantitative background who co-founded 365 Data Science, an educational start-up focused on data science. Since then, he has been creating online courses focused on statistics and machine learning.