![]() |
1
11
伪代码应按以下方式更改: kNN (dataset, sample){ 1. Go through each item in my dataset, and calculate the "distance" from that data item to my specific sample. 2. Classify the sample as the majority class between K samples in the dataset having minimum distance to the sample. } 下图说明了这种伪代码。
假设数据集由两个类别A和B组成,分别显示为红色和蓝色,我们希望将K=5的KNN应用于样本,显示为绿色和紫色星。
精确 :1-(错误分类的测试样本数量/测试样本数量) |
![]() |
PhD Rookie · 选择最可能选项的决策树? 7 年前 |
|
The_Anil · 获取无效类型比较错误 7 年前 |
![]() |
Mohit Shah · 为什么在选择模型之前不进行模型调整? 7 年前 |
![]() |
r1d1 · 主题提取和文本分类在概念上有什么区别? 7 年前 |
![]() |
Sara · 按行从两列中选择重复项,并在R中创建一个新变量 7 年前 |
![]() |
Syahnur Nizam · 使用Weka作为引擎的基于PHP的网站 7 年前 |
![]() |
Abdelghani Info · 为什么使用支持向量机? 7 年前 |