
Answer-first summary for fast verification
Answer: Decision trees, as they can handle non-linear relationships and complex interactions between features, and can be extended to handle multi-class classification tasks.
In a Spark MLlib project for a multi-class classification task, decision trees would be the most suitable algorithm. Decision trees can handle non-linear relationships and complex interactions between features, making them suitable for multi-class classification tasks. They can be extended to handle multiple classes by creating a separate tree for each class or by using techniques such as one-vs-rest. While linear regression and logistic regression are more commonly used for binary classification tasks, decision trees can be adapted to handle multi-class classification tasks. Random forests, an ensemble method that combines multiple decision trees, can also be used for multi-class classification tasks, but decision trees provide more interpretability and flexibility in handling complex patterns in the data.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
In a Spark MLlib project, you are working with a large dataset and need to build a model for a multi-class classification task. Which of the following algorithms would be most suitable for this task, and why?
A
Linear regression, as it can be extended to handle multi-class classification tasks by using techniques such as one-vs-rest.
B
Decision trees, as they can handle non-linear relationships and complex interactions between features, and can be extended to handle multi-class classification tasks.
C
Logistic regression, as it is specifically designed for binary classification tasks and cannot be extended to handle multi-class classification tasks.
D
Random forests, as they are an ensemble method that combines multiple decision trees to improve accuracy and robustness, and can be extended to handle multi-class classification tasks.
No comments yet.