Your team is tasked with building a machine learning model to predict home prices in a new residential development based on historical sales figures and housing features. Because you have labeled training data consisting of both the features and the final selling prices, you need an algorithm that learns the mapping function from inputs to outputs. Which of the following algorithms should you choose?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Here's the deal: when you're working with data where you already know the "right answers"—like historical home prices—you're in the realm of supervised learning. Think of it like a flight simulator with a teacher sitting next to you, correcting your path. Linear Regression is one of the classic workhorses here. It takes those inputs (like square footage) and maps them to a continuous output (price). The other options? K-Means and PCA are unsupervised, meaning they just look for patterns or group data without any labels. And Apriori? That's what supermarkets use to see if people who buy diapers also buy beer. Not what we need here! Stick with supervised learning for labeled data, and you'll do great.
Full explanation below image
Full Explanation
In machine learning, algorithms are broadly classified into supervised and unsupervised learning based on the presence of labeled data. Supervised learning algorithms are trained on a labeled dataset, where each training example is paired with its correct output label. The goal of the algorithm is to learn a mapping function from input variables ($x$) to output variables ($y$). Linear Regression is a fundamental supervised learning algorithm used for regression tasks. It models the relationship between a dependent scalar variable (the output) and one or more explanatory variables (inputs) by fitting a linear equation to the observed data. Because the historical sales data includes both the input features (such as square footage or location) and the target labels (selling prices), it requires a supervised method like Linear Regression. K-Means Clustering (Option A) is an unsupervised learning algorithm. It is designed to partition unlabeled data into $K$ distinct, non-overlapping clusters based on feature similarity. It does not use target labels and cannot make predictions of continuous variables like price. Principal Component Analysis (PCA) (Option C) is an unsupervised dimensionality reduction technique. It is used to project high-dimensional data onto a lower-dimensional space while preserving as much variance as possible. It is not used for mapping inputs to labeled outputs. Apriori Association Rules (Option D) is an unsupervised data mining algorithm used for market basket analysis. It identifies frequent itemsets and association rules within transactional databases, rather than predicting continuous target variables from input features. Therefore, Linear Regression is the correct choice for this supervised learning scenario.