
Answer-first summary for fast verification
Answer: K-nearest neighbors (k-NN)
The question describes a classification problem where an AI practitioner needs to predict flower types based on four numerical features: petal length, petal width, sepal length, and sepal width. This is a classic supervised learning classification task with labeled data. **Analysis of each option:** - **A. K-nearest neighbors (k-NN)**: This is a supervised classification algorithm that works by finding the k most similar data points (neighbors) in the training set to a new data point and assigning the majority class among those neighbors. It's particularly effective for classification tasks with numerical features where similarity can be measured using distance metrics like Euclidean distance. For flower classification with measurements, k-NN can accurately predict categories based on feature proximity, making it highly suitable for this scenario. - **B. K-means**: This is an unsupervised clustering algorithm used to group data points into clusters based on similarity without predefined labels. Since the task requires predicting known flower classifications (supervised learning), k-means is inappropriate as it doesn't use labeled data for classification. - **C. Autoregressive Integrated Moving Average (ARIMA)**: This is a time series forecasting model designed to predict future values based on temporal patterns in sequential data. The flower classification problem involves static measurements without time-dependent elements, making ARIMA completely unsuitable for this use case. - **D. Linear regression**: This is a regression algorithm used to predict continuous numerical values, not categorical classifications. While it could be adapted for classification through techniques like logistic regression (which isn't listed), standard linear regression is fundamentally designed for regression tasks, not for assigning discrete categories like flower types. **Conclusion**: K-nearest neighbors (k-NN) is the optimal choice because it's specifically designed for classification problems with numerical features, can handle multiple input dimensions effectively, and operates on the principle of similarity between data points—perfectly aligning with the requirement to classify flowers based on their physical measurements.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
Which algorithm is suitable for predicting flower classifications using the features petal length, petal width, sepal length, and sepal width?
A
K-nearest neighbors (k-NN)
B
K-mean
C
Autoregressive Integrated Moving Average (ARIMA)
D
Linear regression
No comments yet.