Learn R Programming

QuantileGH (version 0.1.8)

reAssign: Re-Assign Observations Trimmed Prior to Trimmed \(k\)-Means Clustering

Description

Re-assign the observations, which are trimmed in the trimmed \(k\)-means algorithm, back to the closest cluster as determined by the smallest Mahalanobis distance.

Usage

reAssign(x, ...)

# S3 method for tkmeans reAssign(x, ...)

Value

Function reAssign.tkmeans() returns an 'reAssign_tkmeans' object, which inherits from tkmeans class.

Arguments

x

a tkmeans object

...

potential parameters, currently not in use.

Details

Given the tkmeans input, the mahalanobis distance is computed between each trimmed observation and each cluster. Each trimmed observation is assigned to the closest cluster (i.e., with the smallest Mahalanobis distance).

Examples

Run this code
library(tclust)
data(geyser2)
clus = tkmeans(geyser2, k = 3L, alpha = .03)
plot(clus, main = 'Before Re-Assigning')
plot(reAssign(clus), main = 'After Re-Assigning')

Run the code above in your browser using DataLab