本页对应的英文页面已更新,但尚未翻译。 若要查看最新内容,请点击此处访问英文页面。
要训练 k 最近邻模型,可以使用 Classification Learner App。为了获得更大的灵活性,可以在命令行界面中使用 fitcknn
训练 k 最近邻模型。训练模型后,可将模型和预测变量数据传递给 predict
,以预测标签或估计后验概率。
Classification Learner | 使用有监督的机器学习训练模型以对数据进行分类 |
Train Nearest Neighbor Classifiers Using Classification Learner App
Create and compare nearest neighbor classifiers, and export trained models to make predictions for new data.
Visualize Decision Surfaces of Different Classifiers
This example shows how to visualize the decision surface for different classification algorithms.
Supervised Learning Workflow and Algorithms
Understand the steps for supervised learning and the characteristics of nonparametric classification and regression functions.
Classification Using Nearest Neighbors
Categorize data points based on their distance to points in a training data set, using a variety of distance metrics.