最近邻
k 最近邻分类
要训练 k 最近邻模型,可以使用分类学习器。为了获得更大的灵活性,可以在命令行界面中使用 fitcknn 训练 k 最近邻模型。训练模型后,可将模型和预测变量数据传递给 predict,以预测标签或估计后验概率。
App
| 分类学习器 | 使用有监督的机器学习训练模型以对数据进行分类 |
模块
| ClassificationKNN Predict | Classify observations using nearest neighbor classification model (自 R2022b 起) |
函数
对象
主题
- 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.
相关信息
- Speaker Identification Using Pitch and MFCC (Audio Toolbox)