Various clustering methods can be used, see argument clustermethod
.
prediction.strength(xdata, Gmin=2, Gmax=10, M=50,
clustermethod=kmeansCBI,
classification="centroid",
cutoff=0.8,nnk=1,
distances=inherits(xdata,"dist"),count=FALSE,...)
## S3 method for class 'predstr':
print(x, ...)
GMin>1
. Therefore GMin<2< code=""> is
useless.2<>
clusterboot
and
classifnp
.
Certain classification methods are connected to certain clustering
mecutoff
.classification="knn"
, see classifnp
.TRUE
, data will be interpreted as
dissimilarity matrix, passed on to clustering methods as
"dist"
-object, and classifdist
will be used for
classificatioTRUE
will print current number of
clusters and simulation run number on the screen.predstr
.prediction.strength
gives out an object of class
predstr
, which is a
list with componentsM
with relative
frequencies of correct predictions (clusterwise minimum). Every list
entry refers to a certain number of clusters.predcorr
for all numbers of
clusters.classification="centroid"
), but other methods are possible,
see classifnp
. A pair of points A in
the same A-cluster is defined to be correctly predicted if both points
are classified into the same cluster on B. The same is done with the
points of B relative to the clustering on A. The prediction strength
for each of the clusterings is the minimum (taken over all clusters)
relative frequency of correctly predicted pairs of points of that
cluster. The final mean prediction strength statistic is the mean over
all 2M clusterings.kmeansCBI
, classifnp
set.seed(98765)
iriss <- iris[sample(150,20),-5]
prediction.strength(iriss,2,3,M=3)
prediction.strength(iriss,2,3,M=3,clustermethod=claraCBI)
# The examples are fast, but of course M should really be larger.
Run the code above in your browser using DataLab