ksegments: Initialization of cluster prototypes using the centers of k segments
Description
Initializes the cluster prototypes matrix using the centers of k segments (subsets) of the data set.
Usage
ksegments(x, k, ctype)
Arguments
x
a numeric vector, data frame or matrix.
k
an integer specifying the number of clusters.
ctype
a string for the type of centroid. The options are ‘avg’ for average and ‘med’ for median of the objects in the segments. The default is ‘avg’.
Value
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. Its value is ‘avg’ for average or ‘med’ for median of the objects in the segments.
call
a string containing the matched function call that generates this ‘inaparc’ object.
Details
The first segment consists of the first n/k objects. The second segment consists of n/k objects starting from the n/k+1-th object. The process is repeated for k segments. The centers of k segments are assigned as the cluster prototypes.
# NOT RUN {data(iris)
# Generate the prototypes matrix using the means of segmentsres <- ksegments(x=iris[,1:4], k=5, ctype="avg")
v <- res$v
print(v)
# }