An Introductory Guide to Machine Learning

It can seem from the mainstream media that every company is working on a machine learning project that promises to increase their revenue, eliminate competition, and provide revolutionary business insights.

With big promises like that, you might wonder what machine learning is and how it can help your business.

This guide will help to answer some of your questions.


Machine learning in cloud
binary numbers in CPU for machine learning
We’ve put together an introductory guide to machine learning that briefly covers all significant areas of machine learning as a field.

We hope that you can pick the topics that apply to your area of work or interest, and do further research with more confidence.

This article will teach you a basic definition of machine learning, how a machine learning process actually works, and different types of problems this field can solve.

After that, we will look at a few common algorithms before jumping into discussing challenges and limitation of machine learning.

Happy learning! ?

1. The Definition of ML

The definition of machine learning is not set in stone. There are many different variations out there, and their nuances depend on whom you ask and what field they work in.
Before looking at the definitions, let’s place machine learning in the realm of other practices it’s closely related to: computer science, artificial intelligence, deep learning, and data science.


1.1 Machine learning vs. AI vs. deep learning

Traditional media often portraits deep learning as a synonym for AI. That is incorrect.

Machine learning is sometimes identified as one of the main techniques to achieve true AI, but it is just a subfield of AI, not its counterpart.

Deep learning is further a subfield of machine learning, which makes both areas subfields of AI.

What is missing from this venn diagram is computer science, which would encapsulate all three fields.

Data science is another term that you might have heard in relations to machine learning.

Data science is a bit more challenging to place, as it is an umbrella term that includes machine learning, as well as other disciplines of computer science that have little to do with AI.

Artificial intelligence, machine learning and deep learning relation representation
Machine learning elements

1.2 Machine learning in one elegant sentence

When searching for a complete definition of machine learning, one has to turn to the leading authorities in the field.

In their course on AI, University of Helsinki defines machine learning as “systems that improve their performance in a given task with more and more experience or data”.

Andrew Ng, a Stanford University professor and a Coursera co-founder, has another definition. In his widely popular online course on machine learning, Andrew defines machine learning as “the science of getting computers to act without being explicitly programmed”.

That is, as you will learning in the guide, not entirely accurate, as a big part of the machine learning process requires much effort from data scientists.

Another prominent figure in the machine learning field is Tom Mitchell.

His definition of machine learning came out already in 1997. He explained machine learning with a problem, which read:

“A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P, if its performance at tasks in T, as measured by P, improves with experience E”.

What can you take from these definitions? First of all, machine learning revolves around computers progressively getting better at problem-solving.

Secondly, the problem-solving process should happen as autonomously as possible.

All this is achieved through the use of various algorithms that are designed to enable learning and improvement over time when exposed to new data. It is the algorithms that enable a computer to make data-driven decisions.

Let us now peek behind the curtain and see how machine learning processes work.

2. How Machine Learning Actually Works

A lot of information online about machine learning talks about what a machine learning algorithm can do, but not a lot about how it can do it.
To truly understand what machine learning is, and demystify the field, it can be useful to know how one goes about working with a machine learning project.


2.1 What machine learning process looks like

The flowchart below is a good representation of all the steps in a machine learning process. It might look complicated at first but fear not.

It is sufficient to know only a few basic steps to get an entry level understanding of machine learning.

Main Steps in the process of machine learning
A more detailed look at the machine learning process. Source:

Step 0: Decide on a specific business problem to solve

This may seem simple, even trivial, yet surprisingly many companies fail in their efforts to get value out of machine learning simply because they don’t ask the right questions.

The kind of business problem you want to solve with the help of machine learning determines everything in the steps that follow. From the type of algorithm you use, the data you gather, to the metrics you’ll use for performance evaluation of your model.


Step 1: Gather and prepare the data

Once you know what problem you need to solve, you can start collecting the data you need. For example, if your company wants to detect clients that are at risk of churn, you might need to collect data about their purchase activity, customer service interactions, basket size, etc.

Each of these factors is regarded as one feature of the data. The more complicated the problem at hand is, the more features a data set will need to have.

Data preparation process consist of actions like removing duplicates, formatting the data sets, randomizing the order of the data entries, and checking for data imbalances.


Step 2: Choosing a machine learning algorithm

An algorithm is a step-by-step guide that tells a computer how to solve a given task.The algorithms are heavily based on statistics and mathematical optimization.

There are many different algorithms that each fit different problems. Some are better suited to work with images, other with sounds or text files. Size and quality of your data will also play a deciding role. For example, a data set with a lot of features will require longer training time, because the algorithm needs more time to make sense of the data.

What algorithm you should choose also heavily depends on what you want to do with the results the algorithm will produce. How accurate does your result need to be?

How long time do you have to train the model? As training time and accuracy as closely related – one tends to go down with the other – answers to these questions will push you in the directions of different algorithms.

A good data science project will also use several types of algorithms to build robust models that help companies make decisions across a variety of business challenges.


Step 3: Training the algorithm

In this step, an algorithm becomes your model. By introducing the chosen algorithm to your training data set, it learns the patterns and correlations between the data, thereby establishing rules for future use.

As a rule of thumb, you should divide your data into a training set (about 70-80% of your data) and a validation set (remaining 30-20%). The training time will depend on the complexity of the algorithm and the amount of data you have.


Step 4: Evaluation of the model

The validation data set you set aside in the previous step will come in handy now. Because the model has never seen this data before, the performance of the model on this data set will be an indicationof how well the model will work in real life.

What metrics should you choose to evaluate the performance of your model on training data? The answer is: it depends. Dean Abbott put it best in his book “Applied predictive analytics”:

“If the purpose of the model is to provide highly accurate predictions or decisions to be used by the business, measures of accuracy will be used. If interpretation of the business is what is of most interest, accuracy measures will not be used; instead, subjective measures of what provides maximum insight may be most desirable.”

Head with cubes and spheres representing the thinking process of scientists in machine learning data collection

2.2 Who performs the machine learning process

All of the steps mentioned above are done by a group of data scientists.

Ideally, each step will be executed by different data scientists who are specialized in their respective areas.

If you have trouble wrapping your head around why you might need a whole team of data scientists instead of just one, think of a machine learning project as a menu at a restaurant.

A menu would typically include starters, a main, a dessert, and maybe some snacks. All of these dishes require different skill sets to prepare.

Baking is not the same as making a main, savoury dish. And even there, there are huge differences in how you prepare meat, seafood or vegetables.

You can be good at all of these dishes, but that would make you an outlier, not the norm.

In the same fashion, each step of the machine learning process calls for different skill sets.

3. Types of machine learning problems

Often, when you read articles about machine learning, you will stumble upon a question or a phrase that refers to “machine learning problems”.
These are not problems that machine learning as a field has to overcome or solve, but the different ways a machine learning algorithm can learn to perform a task.

There are three core types of machine learning: supervised, unsupervised and reinforced learning.

3.1 Supervised learning

In supervised learning, you begin with a labeled data set to show the algorithms what the correct output should look like.

The term supervised itself refers to the fact that data scientists need to tell the algorithm what they want it to predict The job of the algorithm is to learn the patterns in the data and when introduced to a data set different from the training set, make correct predictions on its own.

For that reason, supervised learning is sometimes referred to as predictive modeling. Supervised learning can be further divided into two groups: classification and regression.

Both can be applied to the same questions, but they will produce vastly different results.

For example, let’s take the problem of determining tomorrow’s weather. A classification algorithm will produce the answers “Hot” or “Cold”, while a regression algorithm will predict a value for the temperature that day.

So, what does this example tell us about these two concepts?

3.1.1 Classification problem

Classification is about predicting a discrete value, such as “yes/no”, “spam/not spam”, or “dog/muffin”. In other words, you are asking a model to group data entries together in two (or more) groups.

If you only have two groups to divide your data in to, you are working with a binary classification. If there are more than two, you have a multi-class classification.

Two types of data classificaiton