Learn R Programming

COveR (version 1.0.4)

r2okm: Cluster data using the R2-OKM algorithm.

Description

Cluster data using the R2-OKM algorithm.

Usage

r2okm(x, centers, lambda = 0, nstart = 10, trace = FALSE, iter.max = 20)

Value

A list containing the clustering results, which includes: - `cluster`: Matrix indicating the cluster assignments for each data point. - `centers`: The final cluster centers. - `totss`: Total sum of squares. - `withinss`: Within-cluster sum of squares for each cluster. - `tot.withinss`: Total within-cluster sum of squares. - `betweenss`: Between-cluster sum of squares. - `size`: Number of data points in each cluster. - `iter`: Number of iterations performed. - `overlaps`: Average number of clusters that each point overlaps with.

Arguments

x

A numeric data matrix or data frame containing the data to be clustered.

centers

Either a positive integer specifying the number of clusters to create or a matrix of initial cluster centers.

lambda

A numeric parameter that controls the clustering behavior, influencing the shape and separation of clusters (default is 0).

nstart

Number of random initializations to find the best clustering result (default is 10).

trace

Logical value indicating whether to display progress information during execution (default is `FALSE`).

iter.max

Maximum number of iterations allowed for the clustering algorithm (default is 20).

Examples

Run this code
r2okm(iris[, -5], 3)
r2okm(iris[, -5], 3, lambda = 0.3)
r2okm(iris[, -5], iris[, -5], lambda = 1)

Run the code above in your browser using DataLab