uniquek | R Documentation |
Initializes the cluster prototypes matrix using the randomly sampled data objects over the unique values of a selected feature.
uniquek(x, k, sfidx)
x |
a numeric vector, data frame or matrix. |
k |
an integer specifying the number of clusters. |
sfidx |
an integer specifying the column index of the selected feature for random sampling. If missing, it is internally determined by comparing the number of unique values for all the features in the data set. The feature having the maximum number of unique values is used as the selected feature. |
The set of unique values of the selected feature is determined, and then k objects were randomly sampled from this set.
an object of class ‘inaparc’, which is a list consists of the following items:
v |
a numeric matrix containing the initial cluster prototypes. |
ctype |
a string representing the type of centroid, which used to build prototype matrix. Its value is ‘obj’ with this function because the cluster prototype matrix contains the sampled objects. |
call |
a string containing the matched function call that generates this ‘inaparc’ object. |
Zeynel Cebeci, Cagatay Cebeci
aldaoud
,
ballhall
,
crsamp
,
firstk
,
forgy
,
hartiganwong
,
inofrep
,
inscsf
,
insdev
,
kkz
,
kmpp
,
ksegments
,
ksteps
,
lastk
,
lhsmaximin
,
lhsrandom
,
maximin
,
mscseek
,
rsamp
,
rsegment
,
scseek
,
scseek2
,
spaeth
,
ssamp
,
topbottom
,
ursamp
data(iris) # Run with the internally selected feature res <- uniquek(x=iris[,1:4], k=5) v <- res$v print(v) # Run with the 1st feature res <- uniquek(x=iris[,1:4], k=5, sfidx=1) v <- res$v print(v)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.