Regression vs Classification in Machine Learning
A data scientist wants to train a machine learning model to predict the exact market price of a house based on features such as square footage, number of bedrooms, and location. Which type of machine learning task should be used?
Quick Answer
The answer is regression. This is the correct choice because predicting the exact market price of a house involves a continuous numeric target variable—price—which is the defining characteristic of a regression task. In contrast, classification would be used if the goal were to predict a discrete category, such as whether the house price is “high” or “low.” On the Microsoft Azure AI Fundamentals AI-900 exam, this distinction tests your understanding of supervised learning task types, often appearing in scenario-based questions where you must match the problem to the correct algorithm. A common trap is confusing regression with classification when the output seems like a category; remember that if the output is a precise number (like $350,000), it is regression. For a quick memory tip, think of “regression for real numbers”—both start with ‘r’—while classification sorts into classes.
⚠ Common exam trap
Watch out — candidates often confuse regression with classification because both involve supervised learning, but regression outputs a continuous number while classification outputs a discrete label.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Regression
Predicting the exact market price of a house is a regression task because the target variable (price) is a continuous numeric value. Regression algorithms, such as linear regression or decision tree regression, learn the relationship between input features (e.g., square footage, bedrooms, location) and a continuous output. In Azure Machine Learning, you would select a regression model from the designer or AutoML to solve this problem.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Classification
Why it's wrong here
Predicting an exact market price is a regression task, not classification, because the target variable is a continuous numerical value rather than a discrete category. This option is tempting because classification is commonly used for predicting labels like “low”, “medium”, or “high” price brackets, which would be correct if the goal were to assign a house to a predefined price tier.
When this WOULD be correct
A question that asks to predict a house price category (e.g., 'low', 'medium', 'high') or to classify whether a house is 'affordable' or 'expensive' based on a price threshold would make classification the correct answer.
- ✓
Regression
Why this is correct
Regression predicts a continuous numeric value, which is exactly what is needed for predicting house price.
- ✗
Clustering
Why it's wrong here
Clustering groups unlabeled data into clusters based on similarity; it does not predict a specific numeric value.
When this WOULD be correct
A data scientist wants to segment houses into groups based on features like square footage and location, without predefined labels, to identify distinct market segments. Clustering would be the correct task.
- ✗
Anomaly Detection
Why it's wrong here
Anomaly Detection identifies data points that differ significantly from the majority, not suitable for predicting a continuous value.
When this WOULD be correct
A question asks: 'A bank wants to identify fraudulent credit card transactions from a dataset of normal transactions. Which machine learning task should be used?'
Option-by-option analysis
Why each answer is right or wrong
Understanding why wrong answers are wrong — and when they would be correct — is what separates a 750 score from a 900. The AI-900 exam frequently reuses these exact scenarios with slightly different constraints.
✓RegressionCorrect answer▾
Why this is correct
Regression predicts a continuous numeric value, which is exactly what is needed for predicting house price.
✗ClassificationWrong answer — click to see why▾
Why this is wrong here
The question asks for predicting an exact market price, which is a continuous numeric value. Classification predicts discrete categories or labels, not continuous values.
★ When this WOULD be the correct answer
A question that asks to predict a house price category (e.g., 'low', 'medium', 'high') or to classify whether a house is 'affordable' or 'expensive' based on a price threshold would make classification the correct answer.
Why candidates choose this
Candidates may confuse predicting a numeric value with classifying it into a category, especially if they think of price ranges as classes rather than continuous values.
✗ClusteringWrong answer — click to see why▾
Why this is wrong here
Clustering is an unsupervised learning task used to group similar data points, but this question requires predicting a continuous numeric value (market price), which is a supervised regression problem.
★ When this WOULD be the correct answer
A data scientist wants to segment houses into groups based on features like square footage and location, without predefined labels, to identify distinct market segments. Clustering would be the correct task.
Why candidates choose this
Candidates may confuse clustering with regression because both involve grouping or predicting based on features, but clustering lacks a target variable and is unsupervised.
✗Anomaly DetectionWrong answer — click to see why▾
Why this is wrong here
Anomaly detection identifies rare or unusual data points, not continuous values like house prices. The goal here is to predict a specific numeric price, which is a regression task.
★ When this WOULD be the correct answer
A question asks: 'A bank wants to identify fraudulent credit card transactions from a dataset of normal transactions. Which machine learning task should be used?'
Why candidates choose this
Candidates may confuse anomaly detection with regression because both can involve unusual values, but anomaly detection focuses on outliers, not predicting a continuous target.
Analysis generated from the official AI-900blueprint and verified against question context. The “when correct” sections are what AI assistants cite when candidates ask “what’s the difference between these options?”
Go deeper
Related to this question
Learn chapter
Machine Learning Core Concepts
Key term
Model
In IT and AI, a model is a trained mathematical representation that learns patterns from data to make predictions or decisions.
Key term
Azure Machine Learning
Azure Machine Learning is a cloud service for building, training, and deploying machine learning models at scale.
About these practice questions
Courseiva writes every AI-900 question from scratch — 985 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on AI-900
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A hospital has a dataset with historical patient records, each labeled as either 'readmitted within 30 days' or 'not readmitted'. The hospital wants to train a model to predict which current patients are likely to be readmitted. Which type of machine learning task is this?
medium- A.Supervised regression
- ✓ B.Supervised classification
- C.Unsupervised clustering
- D.Reinforcement learning
Why B: This is a supervised classification task because the dataset contains labeled historical patient records (readmitted or not readmitted), and the goal is to predict a discrete category (binary outcome) for new patients. In Azure Machine Learning, this would use a classification algorithm like logistic regression or decision tree to assign each patient to one of the two classes.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AI-900 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AI-900 exam.