Classification: lesson 1 of 5
Classification
Understanding Classification Problems
Identify binary and multiclass prediction problems and their business decisions.
Concept
Classification predicts a category, or class, rather than a numeric quantity. Regression estimated house prices and demand. Classification answers questions such as whether a customer will churn, whether a transaction is fraudulent, or which support category a ticket belongs to.
Why It Matters
The target design determines the decision a model supports. Predicting exact customer spend is regression. Predicting whether spend will exceed $500 is classification. Both use historical data, features, and a target, but their outputs, uncertainty, and evaluation needs differ.
Binary and Multiclass Problems
Binary classification has two classes: churn/no churn, fraud/not fraud, spam/not spam, or default/no default. In binary work, the positive class is the class of interest, such as fraud or churn. "Positive" does not mean good; it identifies the outcome the team is watching. The other class is negative.
Multiclass classification chooses one category from several, such as billing, technical, or account support tickets. A product classifier might choose clothing, electronics, or home goods. Lesson 4 develops this distinction further.
Numeric Labels Can Still Be Categories
Labels are often stored as numbers: 0 = no churn, 1 = churn, or 0, 1, 2 for three categories. This does not make the task regression. The values are labels, not measurements with meaningful distances. A model should not assume class 2 is twice as much as class 1 unless the target genuinely represents an ordered quantity.
Framing the Target
"Will the customer churn?" is incomplete until the team defines what churn means, the time window, the eligible population, and the prediction time. Is churn cancellation within 30 days? Is a paused account included? Are only active customers eligible? One row might be one customer at the start of each month, and features must be available then.
Poor labels create poorly defined models. A cancellation field recorded after the decision date cannot be used as a feature. If different teams label the same behavior differently, the model learns that inconsistency. Target design is a business and data-quality task before it is a modeling task.
Scores and Decisions
Many classifiers can produce a score or probability-like value as well as a final class. A churn score of 0.82 may signal higher estimated risk than 0.43, but turning either into a yes/no decision requires a threshold. This lesson identifies the problem type; Lesson 3 explains thresholds.
When to Use Classification
Use classification when the action depends on a category: route a ticket, review a suspicious transaction, prioritize customers for outreach, or assign an image label. The model may make mistakes, so the costs of different wrong decisions need consideration even before detailed metrics are introduced.
Failure Signals
Common Mistakes
- Treating numeric class codes as continuous targets.
- Defining churn or default without a time window.
- Including information only known after the class outcome.
- Calling the positive class "good" by default.
- Choosing an algorithm before defining the action a class prediction will trigger.
Best Practices
Write down the positive class, row grain, prediction horizon, and action for each predicted class. Inspect label frequency and label quality before fitting. Keep a classification target tied to a decision someone can actually make.
Interview Perspective
Question: How do regression and classification differ? Answer: regression estimates a numeric quantity, while classification predicts a discrete category. What the interviewer is testing: whether you frame the target before naming a model. Follow-up: why can 0 and 1 still represent classification?
Practice Questions
- Classify exact delivery time, late/not late delivery, and support-ticket category.
- Is predicting whether spend exceeds $500 regression or classification? Why?
- Define a useful churn target for a subscription service.
- Why can a target stored as
0and1still be categorical? - Which class would you define as positive for equipment-failure prediction?
Quick Quiz
- What does classification predict? Answer: a class or category.
- Does positive mean morally good? Answer: no; it means the class of interest.
- Why specify prediction time? Answer: to ensure features are available before the outcome.
Key Takeaway
Key Takeaways
Classification starts with a well-defined class target, prediction time, and business decision. Binary labels may be numeric in storage while remaining categories in meaning.
Next Lesson
Next, see why logistic regression turns feature patterns into probability-like classification outputs.
Finish this lesson on your terms
Mark it complete when you have worked through the material and are ready to move on.