Learn R Programming

inaparc (version 1.2.0)

topbottom: Initialization of cluster prototypes using the top and bottom objects

Description

Initializes the cluster prototypes matrix using the alternately selected k objects from the top and bottom of the data set.

Usage

topbottom(x, k)

Arguments

x

a numeric vector, data frame or matrix.

k

an integer for the number of clusters.

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, which used to build prototype matrix. Its value is ‘obj’ with this function because the cluster prototype matrix contains the objects.

call

a string containing the matched function call that generates this ‘inaparc’ object.

Details

The function combines the firstk and lastk techniques. It takes the first object of the data set as the prototype of first cluster, and then the last object as the prototype of second cluster. This rotating assigment process continues until the prototypes of k clusters are assigned.

See Also

aldaoud, ballhall, crsamp, firstk, forgy, hartiganwong, inofrep, inscsf, insdev, kkz, kmpp, ksegments, ksteps, lastk, lhsmaximin, lhsrandom, maximin, mscseek, rsamp, rsegment, scseek, scseek2, ssamp, spaeth, uniquek, ursamp

Examples

Run this code
# NOT RUN {
data(iris)
res <- topbottom(x=iris[,1:4], k=5)
v <- res$v
print(v)
# }

Run the code above in your browser using DataLab