mean_sd_obj {anticlust}R Documentation

An objective function measuring similarity of sets

Description

Compute the discrepancy in means and standard deviations between clusters.

Usage

mean_sd_obj(features, clusters)

Arguments

features

A matrix or data.frame of data points. Rows correspond to elements and columns correspond to features.

clusters

A clustering vector

Details

This function can be passed as the argument objective to the function anticlustering to minimize differences in means and standard deviations between anticlusters.

Value

A value quantifying similarity in means and standard deviations. Higher values indicate that means and standard deviations are more similar.

Author(s)

Martin Papenberg martin.papenberg@hhu.de

Examples

data(schaper2019)
features <- schaper2019[1:48, 3:6]
ac <- anticlustering(
  features,
  K = 3,
  categories = schaper2019$room[1:48],
  objective = mean_sd_obj
)
by(features, ac, function(x) round(colMeans(x), 2))
by(features, ac, function(x) round(apply(x, 2, sd), 2))


[Package anticlust version 0.6.0 Index]