
Last chance! 50% off unlimited learning
Sale ends in
nselectboot
and prediction.strength
.classifdist(cdist,clustering,
method="averagedist",
centroids=NULL,nnk=1)classifnp(data,clustering,
method="centroid",cdist=NULL,
centroids=NULL,nnk=1)
dist
-object. Necessary for
classifdist
but optional for classifnp
and there only
used if method="averagedist"
(if not provided, dist
is
applied to d
n*p
-data matrix."averagedist", "centroid", "qda",
"knn"
. See details.classifnp
a k times p matrix of cluster
centroids. For classifdist
a vector of numbers of centroid
objects as provided by pam
. Only used if
method="centroi
method="knn"
.classifdist
is for data given as dissimilarity matrix,
classifnp
is for data given as n times p data matrix.
The following methods are supported:
[object Object],[object Object],[object Object],[object Object]prediction.strength
, nselectboot
set.seed(20000)
x1 <- rnorm(50)
y <- rnorm(100)
x2 <- rnorm(40,mean=20)
x3 <- rnorm(10,mean=25,sd=100)
x <- cbind(c(x1,x2,x3),y)
truec <- c(rep(1,50),rep(2,40),rep(3,10))
topredict <- c(1,2,51,52,91)
clumin <- truec
clumin[topredict] <- -1
classifnp(x,clumin, method="averagedist")
classifnp(x,clumin, method="qda")
classifdist(dist(x),clumin, centroids=c(3,53,93),method="centroid")
classifdist(dist(x),clumin,method="knn")
Run the code above in your browser using DataLab