You are designing a machine learning pipeline and need to decide between using a regression algorithm or a classification algorithm. What is the fundamental difference in the target outputs of these two supervised learning tasks?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Let's dive in. Imagine your boss walks in and asks you to build two models: one to estimate the exact dollar price of a server based on its specs, and another to flag whether that server is going to crash or not. The first task—predicting a continuous number like a price or temperature—is regression. The second task—assigning a discrete label like "healthy" or "failed"—is classification. Think of it like this: regression is measuring, classification is sorting. They're both supervised learning, meaning they need labeled data to start, but they have completely different outputs. Don't let the exam trick you into thinking one is only for images and the other is for text, or that one is unsupervised!
Full explanation below image
Full Explanation
Supervised machine learning is fundamentally divided into regression and classification based on the nature of the output variable.
1. Regression: The objective is to predict a continuous numerical value. The target variable is on a continuous scale, meaning there are infinite possible values within a range. Examples include predicting housing prices, estimating network latency (in milliseconds), or forecasting temperature. 2. Classification: The objective is to predict a discrete class label or category. The target variable belongs to a predefined set of categories. If there are two classes (e.g., spam vs. ham, transaction approved vs. denied), it is binary classification. If there are more than two classes (e.g., classifying animal species or handwritten digits), it is multi-class classification.
Both regression and classification are supervised learning techniques, meaning they train on labeled datasets where the input features map to a known target output. They can both utilize linear or nonlinear models (for instance, Logistic Regression, despite its name, is a classification algorithm, and Decision Trees can be used for both).
- Option A is incorrect because neither task is restricted to a specific data format like images or text; both regression and classification can be applied to numerical, tabular, text, image, or audio data. - Option C is incorrect because both regression and classification can use either linear models (e.g., Linear Regression, Logistic Regression) or nonlinear models (e.g., Random Forests, Neural Networks). - Option D is incorrect because both regression and classification are supervised learning tasks; they require labeled training data.