Learn R Programming

COveR (version 1.0.4)

okm: Clusters data using the OKM (Overlapping K-Means) clustering algorithm.

Description

Clusters data using the OKM (Overlapping K-Means) clustering algorithm.

Usage

okm(x, centers, iter.max = 10, nstart = 1, trace = FALSE, method = "euclid")

Value

A list containing the clustering results, including: - `cluster`: Matrix indicating the cluster assignments for each data point. - `centers`: The final cluster centers. - `tot.withinss`: Total within-cluster sum of squares. - `overlaps`: The measure of overlap among clusters.

Arguments

x

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

centers

Either a positive integer indicating the number of clusters to create or a matrix of pre-initialized cluster centers.

iter.max

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

nstart

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

trace

Logical value indicating whether to display the progress of the algorithm (default is `FALSE`).

method

A string specifying the distance metric to use; options are 'euclid' (Euclidean distance) or 'manhattan' (Manhattan distance) (default is "euclid").

Examples

Run this code
okm(iris[, -5], 3)

Run the code above in your browser using DataLab