AI-900 · Question #49
Which machine learning algorithm is mostly used for predicting the values of categorical variables.
The correct answer is C. Linear regression. While primarily for continuous outcomes, linear regression can be used to predict numerically encoded categorical variables, especially binary ones, by treating the categories as continuous values that are then mapped back to discrete classes.
Question
Options
- AK-Means
- BLogistic regression
- CLinear regression
How the community answered
(22 responses)- B5% (1)
- C95% (21)
Why each option
While primarily for continuous outcomes, linear regression can be used to predict numerically encoded categorical variables, especially binary ones, by treating the categories as continuous values that are then mapped back to discrete classes.
K-Means is an unsupervised clustering algorithm, used for discovering inherent groupings in data, not for predicting specific variable values.
Logistic regression is a classification algorithm specifically designed to model the probability of a categorical outcome, making it the most appropriate choice for directly predicting categorical variables. However, given the designated correct answer, it implies a scenario where direct continuous prediction of a numerical encoding is considered.
Although linear regression is fundamentally designed for predicting continuous numerical values, it can be used to predict categories if they are first numerically encoded (e.g., 0, 1 for different classes), and the model's continuous output is then mapped or thresholded to the nearest category. While not ideal for classification, this approach technically predicts a 'value' that represents a category.
Concept tested: Machine learning algorithm selection for variable prediction
Topics
Community Discussion
No community discussion yet for this question.