Getting Started with AI/ML

What is machine learning and how does it work? | part 2


How does machine learning actually work? This week we will explain the typical ways machine learning is used to tackle problems.

How to tackle problems using machine learning

Last week we spoke about what machine learning is—the field that automates actions by learning through experience, or, in other words, data. Now we are ready to understand how to frame your business problem into a machine learning problem.

Machine Learning Vs Data Science. Learn the difference, and how ML fits within data science

We first need to categorize the problem into a type of learning to help us to understand the tools that are at our disposal. Machine learning problems typically fall into three categories:

    • supervised learning,
    • unsupervised learning and;
    • reinforcement learning.
Supervised learning is a type of learning that uses labeled data to tell the computer what to find. We have ground-truth knowledge. For example, we can easily identify different types of shoes and we give that information to the computer.

There are a few subcategories of supervised learning. One of the most common machine learning tasks is called classification. For this task, the AI tries to identify the category or class that a datum falls into. predicts the class or category for a given observation. For example, an email can be classified as belonging to one of two classes: “spam and “not spam“.? Another category of supervised learning is called regression. Regression is used when you want your algorithm to output a number instead of a class. For example, predict the house price given relevant features like location, proximity to schools, etc.

Unsupervised learning is a type of learning that doesn’t use labeled data. Even though there is no "ground truth" or labeled data, there is still plenty of information inside the data: distribution, pattern, and even data itself can be marked as labels. We use this tool when we have no idea how the results should look. We ask the algorithm to look for hidden features in the data in a way that makes sense. In unsupervised learning problems, the goal is to discover groups of similar examples, which is called clustering. If the goal is to understand how the data is distributed, it is called density estimation

Supervised vs Unsupervised Learning plot diagram

What is the difference between supervised and unsupervised learning?

From a technical perspective, there are a few differences between supervised and unsupervised learning. Supervised learning tells the algorithm what to look for in the data. The goal of supervised learning is to learn a general rule that maps inputs to outputs. What does this mean? Let’s look at an example. If we wanted to train an algorithm to recognize a cat within a photo, we would feed the algorithm with many datasets containing photos of cats and photos without cats. Each photo with a cat must be annotated as ‘cat’ and photos without cats as ‘non-cat’. An input is anything you put into a system and the output is what is given back to you. If we gave a photo of a cat to the algorithm as an input, the output would be ‘cat’. The algorithm is trained in a supervised way to recognize the ‘rules’ that connect an input with an output, or a task. Supervised learning can yield excellent results.

On the other hand, unsupervised learning allows the algorithm to find patterns itself and does not have corresponding target values. As opposed to supervised learning, the input data is not labeled in advance.  When choosing between supervised and unsupervised learning, you must also consider your operational and financial constraints. Supervised learning requires data that has been labeled, while unsupervised does not, whilst there are increasingly more avenues for labeling data, doing it on scale requires resources. Data labeling is another interesting topic that we will delve into further soon.

What about reinforcement learning?

Another way to frame a machine learning problem is called reinforcement learning. Reinforcement learning is a type of machine learning that enables a computer to learn by trial and error through an interactive environment. The trial and error are established through feedback from the computer’s actions and experiences.

Let’s imagine a small mouse running through a maze. He wants the cheese. He takes a right, left, straight, and left. This isn’t an optimal way through the maze and he gets “punished” by receiving no cheese. Again, he runs through the maze, this time armed with the knowledge that he didn’t get the optimal route. The mouse completely avoids taking a left first and starts always taking a right. The mouse would eventually find the path that gives him the whole block of cheese. In a similar way, an algorithm learns optimal solutions through positive and negative reinforcement.

The list is not complete without mentioning Semi-Supervised Learning

The traditional classification of ML algorithm types ends with the three ones we mentioned above, however, semi-supervised learning should be mentioned. It falls between supervised and unsupervised techniques, incorporating elements of both.

With semi-supervised machine learning, the network is trained with a combinatory dataset consisting of both labeled and unlabelled data. This means a learning algorithm can label all the unlabeled data without human interaction just by relying on the initially labeled data. 

Which type of learning is best for my problem?

It can be difficult to know where to start when it comes to framing machine learning problems correctly. One tip is to look objective, whether you have a target variable that you want to predict estimate/classify (supervised) or you want to recognize patterns or structure in your data, an approach helpful when you are exploring the data (unsupervised).

What is machine learning? Machine Learning Hierarchy table

Then you look at your data and the target outcome, for example, if the target/outcome you are trying to predict is discrete/categorical like categories of things then you should use classification e.g. "default vs non-default", "high risk, medium risk, low risk", "Cat or Dogs or Horse. If the target/outcome we want to predict is a number (continuous data) like house prices, the number of bricks needed, air quality, and the number of likes of tweets then use regression.

Unsupervised learning is to understand patterns to discover output. For example, when you’re trying to group together similar data points based on their characteristics (clustering) use, for example in customer segmentation or to group similar features together, for example, to visualize big data (dimensionality reduction).  

Supervised vs Unsupervised Learning - Discrete and Continuous

And lastly reinforcement learning. Which single or multiple agents learn to adapt to the environment. Because reinforcement models learn through a continuous process of receiving rewards and punishments for every action taken, it is able to train systems to respond to unforeseen environments. Applications could be for inventory management, industrial automation, or driverless car control.

     Reinforcement Learning image

Wrap-up:

I hope you’ve gained a better understanding of ways to frame business problems as machine learning problems. Please get in touch if you would like to understand whether machine learning can help your business. 

 

Ready to try a machine learning solution? Get started by booking a quick demo with our specialist. 

Book a demo 

 

Similar posts