kmeansCluster {Evacluster}R Documentation

K-means Clustering

Description

This function classifies unlabeled data by grouping them by features, rather than pre-defined categories. It splits the data into K different clusters and describes the location of the center of each cluster. Then, a new data point can be assigned a cluster (class) based on the closed center of mass.

Usage

kmeansCluster(data = NULL, ...)

Arguments

data

A Data set

...

center: The number of centers

Value

A list of cluster labels and a R object of class "kmeans"

Examples

library(datasets)
data(iris)

rndSamples <- sample(nrow(iris),100)
trainData <- iris[rndSamples,]
testData <- iris[-rndSamples,]

cls <- kmeansCluster(trainData[,1:4],3)

[Package Evacluster version 0.1.0 Index]