myKmean: K-means clustering

Description Usage Arguments Value

View source: R/clustering_algorithms.R

Description

This function is a wrapper to kmeans in the package stats.

Usage

1
myKmean(X, k)

Arguments

X

data matrix or data frame of size n x d, n observations and d features

k

number of clusters

Value

list of 3 components:

cluster

vector of integer between 1 and k containing the allocation of each point

centers

matrix (d x k) of the centers of each cluster

predict

function predicting to which cluster an observation belongs. The input can be a single observation vector or a matrix of several observations. The assigned cluster is the one with the closest center to the given observation.


mattmail/clusterAnalysis documentation built on Nov. 4, 2019, 6:18 p.m.