Initialization of cluster prototypes using the centers of k segments
Initializes the cluster prototypes matrix using the centers of k segments (subsets) of the data set.
ksegments(x, k, ctype)
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’. |
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.
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. |
Zeynel Cebeci, Cagatay Cebeci
data(iris) # Generate the prototypes matrix using the means of segments res <- ksegments(x=iris[,1:4], k=5, ctype="avg") v <- res$v print(v)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.