multiedit(class)
multiedit()所属R语言包:class
Multiedit for k-NN Classifier
multiedit为K-NN分类
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Multiedit for k-NN classifier
multiedit为K-NN分类
用法----------Usage----------
multiedit(x, class, k = 1, V = 3, I = 5, trace = TRUE)
参数----------Arguments----------
参数:x
matrix of training set.
矩阵的训练集。
参数:class
vector of classification of training set.
训练集分类的向量。
参数:k
number of neighbours used in k-NN.
K-NN使用邻居的数量。
参数:V
divide training set into V parts.
划分成V部分设置的培训。
参数:I
number of null passes before quitting.
通过戒烟前的空数。
参数:trace
logical for statistics at each pass. </table>
在每轮的统计逻辑。 </ TABLE>
值----------Value----------
Index vector of cases to be retained.
指数向量的情况下予以保留。
参考文献----------References----------
Pattern Recognition. A Statistical Approach. Prentice-Hall, p. 115.
Pattern Recognition and Neural Networks. Cambridge.
Modern Applied Statistics with S. Fourth edition. Springer.
参见----------See Also----------
condense, reduce.nn
condense,reduce.nn
举例----------Examples----------
tr <- sample(1:50, 25)
train <- rbind(iris3[tr,,1], iris3[tr,,2], iris3[tr,,3])
test <- rbind(iris3[-tr,,1], iris3[-tr,,2], iris3[-tr,,3])
cl <- factor(c(rep(1,25),rep(2,25), rep(3,25)), labels=c("s", "c", "v"))
table(cl, knn(train, test, cl, 3))
ind1 <- multiedit(train, cl, 3)
length(ind1)
table(cl, knn(train[ind1, , drop=FALSE], test, cl[ind1], 1))
ntrain <- train[ind1,]; ncl <- cl[ind1]
ind2 <- condense(ntrain, ncl)
length(ind2)
table(cl, knn(ntrain[ind2, , drop=FALSE], test, ncl[ind2], 1))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|