knn.cv(class)
knn.cv()所属R语言包:class
k-Nearest Neighbour Cross-Validatory Classification
K-近邻的跨Validatory分类
译者:生物统计家园网 机器人LoveR
描述----------Description----------
k-nearest neighbour cross-validatory classification from training set.
k-近邻的跨validatory分类训练集。
用法----------Usage----------
knn.cv(train, cl, k = 1, l = 0, prob = FALSE, use.all = TRUE)
参数----------Arguments----------
参数:train
matrix or data frame of training set cases.
矩阵或数据框的训练集情况。
参数:cl
factor of true classifications of training set
真正的训练集分类的因素
参数:k
number of neighbours considered.
认为邻居数目。
参数:l
minimum vote for definite decision, otherwise doubt. (More precisely, less than k-l dissenting votes are allowed, even if k is increased by ties.)
明确的决定,否则doubt的最低投票。 (更确切地说,允许比k-l反对票少,即使k关系增加。)
参数:prob
If this is true, the proportion of the votes for the winning class are returned as attribute prob.
如果这是真的,获奖类票的比例返回属性prob。
参数:use.all
controls handling of ties. If true, all distances equal to the kth largest are included. If false, a random selection of distances equal to the kth is chosen to use exactly k neighbours. </table>
控制关系的处理。如果情况属实,所有的距离等于k日最大列入。如果为false,随机选择一个距离等于k日选择使用完全k邻居。 </ TABLE>
Details
详情----------Details----------
This uses leave-one-out cross validation. For each row of the training set train, the k nearest (in Euclidean distance) other training set vectors are found, and the classification is decided by majority vote, with ties broken at random. If there are ties for the kth nearest vector, all candidates are included in the vote.
这使用留一出交叉验证。对于每行设置培训train,k最近(在欧几里德距离)其他训练集向量,分类随意打破的关系,以多数票决定。如果是关系k日最近向量,包括所有候选人中投票。
值----------Value----------
Factor of classifications of training set. doubt will be returned as NA.
训练集分类的因素。 doubtNA将返回。
参考文献----------References----------
Pattern Recognition and Neural Networks. Cambridge.
Modern Applied Statistics with S. Fourth edition. Springer.
参见----------See Also----------
knn
knn
举例----------Examples----------
train <- rbind(iris3[,,1], iris3[,,2], iris3[,,3])
cl <- factor(c(rep("s",50), rep("c",50), rep("v",50)))
knn.cv(train, cl, k = 3, prob = TRUE)
attributes(.Last.value)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|