Machine Learning for absolute beginners

Inès Chokri
Jan 26 · 8 min read

Introduction

Machine Learning is used everywhere nowadays, from Netflix predictive analytics to self driving cars, we are using this advanced technology in our everyday life without even realizing it. It has been growing in popularity in the last few years, more and more people are getting interested in Machine Learning and would like to know more about it.

If you’re one of those people, whether your are familiar with it or not, then this article is for you.

But before we get fully into Machine Learning, we’ll clarify the differences between Artificial Intelligence (AI), Machine Learning (ML) and Deep Learning (DL) first, since people usually put them in the same bag as it is a little ambiguous.

The difference between AI, ML and DL

What is Artificial Intelligence ?

Artificial Intelligence, this technology that is revolutionizing everything, is a branch of computer science dedicated to creating intelligent machines that mimic the human behavior. We can divide AI into two main themes : weak and strong.

Weak AI, also called narrow, is an Artificial Intelligence with limited functionalities. It refers to machines that are using advanced algorithms to accomplish specific problem solving or reasoning tasks. For example, the voice-based personal assistants such as Siri and Alexa could be considered weak AI programs because they operate within a limited pre-defined set of functions meaning they often have a programmed response.

Whereas strong AI is an Artificial Intelligence that can make machines develop a human consciousness. It refers to machines or programs with the mind of their own and which can think and accomplish complex tasks by themselves without any human interference. This level of consciousness haven’t been reached yet but it is evolving really fast and we might see it very soon.

Artificial Intelligence has three different types :

1 — Reactive machine

This kind of Artificial Intelligence are purely reactive and do not hold the ability to form memories or use past experiences to make decisions. These machines are designed to do specify jobs.

2 — Limited memory

This kind of Artificial Intelligence uses past experience and present data to make a decision.

3 — Theory of mind

These kind of machines can socialize and understand humans emotions. They will try to mimic those emotions.

Artificial Intelligence can be achieved with Machine Learning.

What is machine learning ?

Machine Learning is a subfield of Artificial Intelligence. It is the science of making computers learn and act like humans by feeding them data and information without being explicitly programmed. To put it simply, machine learning provides Artificial Intelligence the ability to learn.

Deep Learning is a particular way of doing Machine Learning.

What is Deep Learning ?

Deep Learning is an autonomous, self-teaching system in which we use existing data to train algorithms to find patterns and then use them to make predictions about new data. It has the ability to mimic a human’s brain neural network. For example, let’s say we built a robot and we want it to recognize us. We would train it by feeding its program with thousands of images either of us or not. Our robot will then establish patterns by classifying and clustering the image data. Those patterns will then form a predictive model that is able to look at a new set of images and predict whether they contain us or not.

I would like to introduce to you another way of doing Machine Learning that is called Reinforcement Learning.

Reinforcement Learning (RL) is the process of learning in an environment, through feedback from an AI’s behavior. As kids, we had to learn to walk by ourselves, no one really told us how to walk, we just practiced, stumbled again and again until we got it and finally put one foot in front of the other. It is the same with machines, we fed them with data and we let them learn by themselves. They will gain experience like humans do by making mistakes and they will learn from it (unbelievable right ?)


Before moving on with Machine Learning, here is a little schema to better understand the relationship of AI, ML, DL and RL.

Methods of Machine Learning

Every technology has methods, a way of doing things, and Machine Learning has two popular methods, supervised and unsupervised learning.

Supervised learning

Supervised learning is the process of learning with training labels, but what are those training labels ? What do we mean by it ? To better explain this concept, imagine having a kid (or maybe you already do ?), we want to teach that kid colors name. We would, for example, show the kid the color red and tell him that this is the color red, then we’d show him the green color and tell him that this the color green. Showing the kid the color and say which color it is, is the training label, so when we show the green color to the kid again, and ask him which color it is, it will either answer green or red. If he doesn’t give the correct answer, we will tell him that he is wrong. This is how supervised learning works. We feed the machine with labeled data and we let it process them, then we point out mistakes during the learning process.

Input data
Ask and robot will either answer by green or red depending on its previous experience

Unsupervised learning

Unlike supervised learning, unsupervised learning is the process of learning without training labels. It is also called clustering or grouping. It isn’t setup in advance to pick out specific types of data, it simply looks for data that can be grouped by its similarities. We feed the machine with tons of data and we let it learn by itself.

Approaches of machine learning

Machine Learning has different approaches, or we could also call them algorithms. An algorithm is a set of rules and statistical techniques used to learn patterns from data and draw significant information from it. It is the logic behind a Machine Learning model.

Lots of different algorithms are offered to us :

Supervised Algorithms :

1 — Linear Regression :

One of the most popular algorithms, it is a supervised learning algorithm that predicts an outcome based on continuous features. You’re invited to check this link, to have a better understanding of linear regression. Linear Regression can be used, for example, to predict the weather.

2 — Decision Tree :

It is used for classification and regression purposes. Decision Trees learn from data to approximate a sine curve with a set of if-then-else decision rules. The deeper the tree, the more complex the decision rules and the fitter the model.

Watch this interesting video about Decision Trees !

3 — Support Vector Machine :

Support Vector Machine is a well known supervised classification algorithm that creates a dividing line between the different categories of data.

4 — K-nearest Neighbors :

K-nearest Neighbors is a supervised learning algorithm specializing in classification. Here’s a video that explains it.

5 — Random forests :

It is a popular supervised ensemble learning algorithm. ‘Ensemble’ means that it takes a bunch of “weak learners” and has them work together to form one strong predictor.

Unsupervised Algorithms :

1 — K-means clustering :

K-means clustering is an unsupervised learning classification algorithm typically used to address the clustering problem.

K : represents the number of clusters inputted by the user. It is ultimately up to the data scientist to select the correct “k” value.

2 — Principal Component Analysis :

Principal Component Analysis (CPA) is a dimensional reduction algorithm that can do a couple of things for data scientists.

How to choose the right algorithm

As Dr. Hui Li said :

When choosing an algorithm, always take these aspects into account: accuracy, training time and ease of use. Many users put the accuracy first, while beginners tend to focus on algorithms they know best.

To know which algorithm would better fit your case, ask yourself those following questions :

1 — What is the size, quality and nature of you data ?

2 — What do you wanna do with the data ?

3 — How fast do you want it to be ?

4 — How accurate you want it be ?

Then, we could also test which algorithm suits us better by testing them with our data.

I invite you to check this link for more details.

Machine Learning application in real world

Image recognition :

One of the most common uses of machine learning is image recognition. There are many situations where Image recognition is needed. Facebook does use this technology to detect if someone’s face in the posted image and will ask the user if it wants to identify that person or not.

Image recognition could also be used to look for a criminal in a crowd of people. The machine would detect if a wanted person is in the image taken by the camera in real time.

Medical Diagnosis :

Machine learning provides methods, techniques, and tools that can help solving diagnostic and prognostic problems in a variety of medical domains. It could predict disease progression, extract medical knowledge for outcomes research. Machine learning is also being used for data analysis, such as detection of regularities in the data by appropriately dealing with imperfect data, interpretation of continuous data used in the Intensive Care Unit, and for intelligent alarming resulting in effective and efficient monitoring.

Conclusion

We have seen what is the difference between Artificial Intelligence, Machine Learning and Deep Learning. We have seen the different approaches of Machine learning, its different algorithms, its different methods and how to choose the right algorithm.

Artificial Intelligence is the future of humanity, the world is evolving at a high speed. Twenty years ago we wouldn’t have imagined all this and yet here we are. But I wonder, is Artificial Intelligence a positive step for humanity ? won’t it destroy us ? will machines take over the world ? Will scientists reach an artificial intelligence that is very close to ours ?


Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade