Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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’.

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.

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.

Author(s)

Zeynel Cebeci, Cagatay Cebeci

See Also

Examples

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)

inaparc

Initialization Algorithms for Partitioning Cluster Analysis

v1.1.0
GPL (>= 2)
Authors
Zeynel Cebeci [aut, cre], Cagatay Cebeci [aut]
Initial release
2020-02-08

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.