ksegments: Initialization of cluster prototypes using the centers of k...

View source: R/inaparc.R

ksegmentsR Documentation

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

crsamp, firstk, inofrep, inscsf, insdev, kkz, kmpp, ksteps, lastk, lhsrandom, lhsmaximin, mscseek, rsegment, scseek, scseek2, spaeth, ssamp, topbottom, uniquek, ursamp

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 documentation built on June 16, 2022, 5:09 p.m.