...

/

Teach Your Model to Choose

Teach Your Model to Choose

Learn how classification models categorize data, making discrete choices based on learned patterns and decision boundaries.

In the previous section, you used regression models to predict continuous values such as house prices or temperatures.

Now, we’ll shift to a different problem—classification—where the goal is to predict categories or labels instead of numeric values. For example, you might want to detect whether an email is spam or predict whether a customer will churn or stay. Classification models are designed for these tasks where the output falls into one of several predefined classes.

What is classification?

Classification is a machine learning task where the model learns to assign input data into one of several predefined categories or classes. Instead of forecasting a number, our model predicts a label or a group.

Press + to interact
Balls classified by color
Balls classified by color

Classification analyzes input data and predicts which discrete category it belongs to. Think of it as teaching the model to sort items into distinct buckets. This relationship can be expressed in equation form as:

Here, XX represents our input variables or features, but CC now stands for the predicted category or class. During training, the model learns from examples where both the features (XX ...