cluster_kmeans: k-means

View source: R/clu_kmeans.R

cluster_kmeansR Documentation

k-means

Description

Creates a clusterer object that uses the k-means method It wraps the stats library.

Usage

cluster_kmeans(k = 1)

Arguments

k

The number of clusters to form.

Value

A k-means object.

Examples

# setup clustering
model <- cluster_kmeans(k=3)

#load dataset
data(iris)

# build model
model <- fit(model, iris[,1:4])
clu <- cluster(model, iris[,1:4])
table(clu)

# evaluate model using external metric
eval <- evaluate(model, clu, iris$Species)
eval

daltoolbox documentation built on May 29, 2024, 1:57 a.m.