gpt4 book ai didi

classification - k最近邻算法中k的值

转载 作者:行者123 更新时间:2023-12-04 09:41:34 25 4
gpt4 key购买 nike

我有7个类别需要分类,并且有10个功能。在这种情况下,我是否需要使用k的最佳值,还是我必须针对1到10(大约10)之间的k值运行KNN,并借助算法本身确定最佳值?

最佳答案

除了我在评论中发布的the article之外,还有this one,它还建议:

Choice of k is very critical – A small value of k means that noise will have a higher influence on the result. A large value make it computationally expensive and kinda defeats the basic philosophy behind KNN (that points that are near might have similar densities or classes ) .A simple approach to select k is set k = n^(1/2).



这将在很大程度上取决于您的具体情况,有时最好遍历k的每个可能值并自行决定。

关于classification - k最近邻算法中k的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11568897/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com