kmeansAIC: AIC of k-means cluster

Description Usage Arguments Author(s) References Examples

View source: R/kmeansAIC.R

Description

calculate the AIC of a specific k-means cluster and it specified centroids

Usage

1
kmeansAIC(fit)

Arguments

fit

Author(s)

Markus Mayer

References

http://sherrytowers.com/2013/10/24/k-means-clustering/

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (fit) 
{
    m = ncol(fit$centers)
    k = nrow(fit$centers)
    D = fit$tot.withinss
    return(D + 2 * m * k)
  }

kmeansstep documentation built on May 31, 2017, 2:50 a.m.