Discover projects
News Post

An Introduction to Machine Learning

Machine Learning

January 16, 2023

8 min read

So, you have heard a lot of people talking about machine learning, and you wonder what all the hype is about.

Very briefly, before we go into a proper explanation, let me excite you with a simple scenario. So, when you were born, you started learning a lot of things based on your interactions with them. For example, you learnt not to touch fire because you were instructed never to touch it, as it can hurt you. But you were probably very curious and decided to find out for yourself, so you stepped near the lit candle and tried touching the beautiful teardrop-like rainbow, and ouch! You discovered this beautiful “rainbow” ain’t so nice at all. You have now learnt what touching a teardrop-like rainbow feels like. Based on this little experience of yours, the million-dollar question is:

‍WOULD YOU TOUCH A RAINBOW ON A GAS STOVE?

Your answer is probably, DEFINITELY NOT! Because you have been able to generalize an experience to other scenarios without being explicitly told. You might even be scared to touch fires in textbooks, but over time, as you interact more with other drawings in a book, you can make proper deductions about which scenarios could hurt you if you touch “the rainbow”.

You feel smart, right? You are able to learn from your experiences. Even a dog, which is not human, can learn from experience and can tell whether you are a danger or not. Even the little cockroach can sense some danger and dribble you around to avoid death. Oh! God must be smart to have created these. What if you can do the same? Wow! You would feel like God, right? Well, that’s what we call ARTIFICIAL INTELLIGENCE. Artificial Intelligence is simply creating systems which are able to reason and make deductions, simulating human intelligence. This means Artificial Intelligence is not just some piece of metal doing some mechanical work; rather, it is a system which tries to reason before making a certain decision (and of course, can be used to power some arranged piece of metal to carry out a task). Now, let’s get a bit technical.

Machine Learning and Artificial Intelligence

A common mistake people make in the industry is thinking machine learning and artificial intelligence are the same. Although a lot of people use artificial intelligence as a synonym for machine learning, they are quite different.

Artificial Intelligence (AI)

AI is a broad discipline which aims at creating intelligent machines. Intelligence in this case is the ability to reason and make deductions or inference given a certain task. Alan Turing said that a system can be deemed intelligent if it can trick a person into thinking it is human.

Turing Test

Given an interrogator, a human participant, and a computer participant, the interrogator, who is unaware of the two participants’ locations, communicates with both. The computer will be deemed “intelligent” if the interrogator cannot tell with certainty which participant is the computer and which is the human.

What is machine learning?

Machine Learning is an application of artificial intelligence which provides systems the ability to learn and improve from experience without being explicitly programmed. In machine learning, we simply provide some data to an algorithm and allow the algorithm to learn patterns in the provided data, thereby developing an ability to predict (and generalize to) unseen but related scenarios. The primary aim in machine learning is to allow computers to learn automatically from data without human intervention. Machine learning can be understood as a branch of Artificial Intelligence. Today, machine learning forms a major part of Artificial Intelligence.

Supervised Learning

Supervised Machine Learning algorithms make use of labelled data to train. This means that we feed the algorithm data for which we already know the output.

The algorithm thus learns patterns (or features) of the data and maps them to the output which is provided. The labelled data thus serves as guidance for the model to learn. The model checks the relationships between the features of an instance and takes a peek at what the output is to see if it has made a correct prediction; if not, it adjusts its learning to achieve an optimal solution (reducing the difference between the actual labels and predictions).

Supervised machine learning algorithms are broadly classified into two:

‍Classification and Regression.

Classification: is a supervised machine learning algorithm which maps input features to a particular discrete label. In classification, the target value (dependent variable) is a discrete value. Classification tasks can be binary or multi-class: a binary classification task is one where there are only 2 target values (e.g. Yes or No; Fraud or Not Fraud; Normal or Abnormal), while a multi-class classification task is one where there are more than 2 target values (e.g. A to Z; 0 to 9; Triangle, Square, or Circle).

Regression: is a supervised machine learning approach which maps input features to a continuous value label. In regression, the target value (dependent variable) is a continuous value. Examples of regression tasks are the prediction of product weight, the prediction of an object's height, etc.

Quick Exercise:

Is this a classification problem or Regression?

1. Predicting House Prices based on area

2. Predicting whether a document is related to sightings of UFOs 3. Predicting stock prices in finance

4. Predicting Power usage in high-performance computing

5. Predicting Age of employees at eBlocks

6. Predicting nationality of a person

7. Predicting whether stock price of a company will increase tomorrow

8. Predicting the rate of exchange between Dollar and Rand on 1st December 2019

9. Predicting if eBlocks will close for the year in December

10. Predicting the gender of a person by his/her handwriting style

11. Predicting the number of copies of a music album that will be sold next month

12. Predicting the momentum of CBR for the next iteration.

13. Predicting the strength of Rand against Dollar

Unsupervised Learning

Unsupervised Machine Learning algorithms are those algorithms which do not require labelled data to train. You can feed unstructured or unlabelled data into your model, and it will learn from the data even though the model has no access to the actual outcome. You will observe that this differs quite a bit from supervised learning, where the model has some guidance, as it is able to adjust its learning by minimizing the difference between the actual outcome and the predicted outcome.

In unsupervised learning, the algorithm simply checks the relationships between features of a particular instance and observes how a similar pattern is repeated in some other instances in the data provided. Unsupervised learning is a very efficient machine learning approach, as it helps to find all kinds of unknown patterns in data. With unsupervised learning, you can easily find which feature to use for classification. Another advantage of unsupervised learning over supervised learning is that, in the real world, it is easier and more common to get unlabelled data than labelled data.

Quick Exercise

1. Can you separate all employees of eBlocks Software based on your discretion?

2. Can you separate eBlocks Boardroom based on your discretion?

Semi-Supervised Learning

Semi-supervised learning is a hybrid of supervised and unsupervised machine learning. In semi-supervised learning, you provide partially labelled data for a model to learn from. Only a few samples of labelled data are available, so you want to make the model learn based on the labelling. In this case, the model is partially guided to know what particular outcome we are interested in and looks at all other instances and tries to separate them based on the outcomes (or target values) provided.

Quick Exercise

If Tayla and Heather are selected to be part of a group and Tafadzwa and Sashi are selected to be part of another group, which groups would you put Candice, Jeremiah, and Deon in?

‍Reinforcement Learning

This type of machine learning algorithm is a bit different from the ones mentioned above. In reinforcement learning, the algorithm is made to interact with its environment and learn better through the use of a carrot-and-stick approach. The algorithm is penalized if it makes errors and rewarded if it does well. The goal is to minimize penalties and obtain the maximum reward.

Quick Exercise

Jeremiah is a one-year-old baby. His elder sister Tayla has been instructed by their father, Sashi, to teach Jeremiah to walk within a few months, and if Jeremiah is not able to walk within the given time period, Tayla will be grounded for 6 months and won’t be given her usual R150 a day of upkeep. Tayla wants to teach Jeremiah to walk, but Jeremiah would rather crawl around looking for where he might find some sweets. HOW CAN TAYLA HELP JEREMIAH LEARN TO WALK SO THAT SHE CAN AVOID BEING GROUNDED?

Related posts

Keep learning

Rethink by eBlocks

Insights and publications for delivery leaders, straight to your inbox.

Practical perspectives on delivery performance, responsible AI adoption and modernisation — plus new Rethink publications as they release. No noise, and you can unsubscribe any time.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

By subscribing you consent to receive Rethink email from eBlocks Software. We handle your details as described in our privacy policy, and every issue includes an unsubscribe link.