No history yet

Introduction to Machine Learning

What Is Machine Learning?

Machine learning is a way of teaching computers to learn from data, without being explicitly programmed for every task. Think of it as a computer figuring things out on its own, based on the examples it's shown.

In traditional programming, you write a set of rules for the computer to follow. To create a spam filter, you might write rules like, "If an email contains the phrase 'free money', mark it as spam." This works, but it's brittle. What if the spammer writes 'fr3e m0ney'? You'd need to add another rule. And another. And another.

Machine learning takes a different approach. Instead of writing rules, you show the computer thousands of emails that you've already marked as spam or not spam. The machine learning model then learns the patterns that distinguish spam from legitimate emails on its own. It might notice that spam often uses certain words, comes from strange addresses, or has lots of exclamation marks. It learns these patterns from the data, rather than being told them directly.

Traditional programming is about writing explicit rules. Machine learning is about learning rules from data.

The Three Flavours of Learning

Machine learning isn't just one single thing. It's a broad field with several different approaches. The three main types are supervised, unsupervised, and reinforcement learning. Let's look at each one.

Lesson image

Supervised Learning

This is the most common type of machine learning. The name 'supervised' comes from the idea that a 'teacher' or supervisor guides the learning process. In this case, the teacher is the labelled data you provide.

Imagine teaching a child to identify different animals. You show them a picture of a cat and say "cat." You show them a picture of a dog and say "dog." After enough examples, the child learns to distinguish between them. Supervised learning works in much the same way. The algorithm is trained on a dataset where the 'right answers' are already known.

Example: A spam filter is a classic case of supervised learning. The data is a collection of emails, and each one is labelled as either 'spam' or 'not spam'. The model learns the characteristics of spam so it can classify new, unseen emails.

Unsupervised Learning

What if you don't have labelled data? That's where unsupervised learning comes in. Here, the algorithm is given a dataset and tasked with finding patterns or structures on its own, without any labels to guide it.

Think of being given a box of assorted Lego bricks and asked to sort them. You might group them by colour, by shape, or by size. You're finding the underlying structure in the data without being told what the categories should be.

Example: A news website might use unsupervised learning to group thousands of articles into topics like 'politics', 'sports', and 'technology'. The algorithm identifies articles with similar words and phrases and clusters them together automatically.

Reinforcement Learning

Reinforcement learning is about learning through trial and error. An 'agent' (the model) learns to make decisions by performing actions in an environment to achieve a goal. When it takes an action that gets it closer to the goal, it receives a reward. When it takes a wrong action, it gets a penalty.

It's like training a dog. When it sits on command, you give it a treat (a reward). When it chews the furniture, you say "No!" (a penalty). Over time, the dog learns which actions lead to rewards.

Example: Self-driving cars use reinforcement learning to learn how to drive. The agent is rewarded for making good decisions, like staying in its lane and obeying traffic laws, and penalised for bad ones, like hitting a curb.

Learning in the Wild

You interact with machine learning every day, often without realising it. When Netflix suggests a movie you might like, that's supervised learning at work, predicting what you'll enjoy based on your viewing history and what similar users have watched.

When Amazon recommends products 'frequently bought together', it's using unsupervised learning to find associations in purchasing data. And the AI opponents in many video games learn to play against you using reinforcement learning, getting better with every game they play.

Lesson image

From translating languages to detecting fraud, machine learning is a powerful tool that allows us to find insights and automate complex tasks in ways that were previously impossible with just traditional programming.

Ready to test your knowledge? Let's see what you've learned.

Quiz Questions 1/5

What is the primary difference between machine learning and traditional programming?

Quiz Questions 2/5

You are given a large dataset of emails and are tasked with creating a spam filter. You have already labelled each email as either 'spam' or 'not spam'. Which type of machine learning is most appropriate?

This is just the beginning. By understanding these core concepts, you've taken the first step into the fascinating world of machine learning.