No history yet

Introduction to Classification

Sorting the Digital World

Much of machine learning comes down to a simple task: sorting. Just as you might sort your mail into piles for bills, letters, and junk mail, a machine learning model can be taught to sort data into categories. This process is called classification.

Classification is a type of supervised learning, which means we teach the computer by showing it examples. The goal is to train a model that can take a new, unseen piece of data and assign it to a predefined category, or “class.”

You encounter classification models every day. Your email service uses one to decide if an incoming message is “spam” or “not spam.” A doctor might use a model to classify a tumor as “benign” or “malignant” based on an image. When your photo app recognizes your friend's face, it's classifying a part of the image as belonging to a specific person.

The Building Blocks

To teach a machine how to classify things, we need to give it the right information. This information is broken down into a few key components.

Features

noun

The individual, measurable properties or characteristics of the data you're analyzing.

If features are the questions, labels are the answers. A label is the correct category for a piece of data. For an email, the label might be "spam." For a medical image, it might be "malignant." During the learning phase, we provide data that includes both the features and the correct labels.

A model learns the relationship between features and labels. The goal is to get so good at it that it can predict the label for new data it has never seen before.

The learning process is split into two main phases: training and testing.

Training Data: This is the initial dataset used to teach the model. It's a large collection of examples where we already know the correct labels. For a cat photo detector, the training data would be thousands of images, each one labeled as either “cat” or “not a cat.” The model analyzes this data to find patterns that connect the features (like pixels, shapes, and colors) to the labels.

Testing Data: Once the model is trained, we need to see how well it actually works. We use a separate set of data that the model has never seen before. We feed this testing data into the model and see what labels it predicts. Then, we compare its predictions to the actual labels to measure its accuracy.

Lesson image

Think of it like studying for an exam. The training data is your textbook and practice problems where you have the answer key. The testing data is the final exam, where you have to apply what you've learned to new questions without any help. A good model is one that can generalize from the training data to perform well on the testing data.

Let's check your understanding of these core concepts.

Quiz Questions 1/5

In machine learning, what is the primary goal of classification?

Quiz Questions 2/5

A developer is building a model to identify photos of cats. They have a dataset of 10,000 images, each correctly marked as either 'cat' or 'not a cat'. What is the term for these 'cat' and 'not a cat' markers?

By understanding features, labels, and the roles of training and testing data, you have the foundation for exploring how different classification models work.