Learn R Programming

kpodclustr (version 1.1)

kpod: Function for performing k-POD

Description

kpod Function for performing k-POD, a method for k-means clustering on partially observed data

Usage

kpod(X, k, kmpp_flag = TRUE, maxiter = 100)

Arguments

X

Data matrix containing missing entries whose rows are observations and columns are features

k

Number of clusters

kmpp_flag

(Optional) Indicator for whether or not to initialize with k-means++

maxiter

(Optional) Maximum number of iterations

Value

cluster: Clustering assignment obtained with k-POD

cluster_list: List containing clustering assignments obtained in each iteration

obj_vals: List containing the k-means objective function in each iteration

fit: Fit of clustering assignment obtained with k-POD (calculated as 1-(total withinss/totss))

fit_list: List containing fit of clustering assignment obtained in each iteration

Examples

Run this code
# NOT RUN {
p <- 5
n <- 200
k <- 3
sigma <- 0.15
missing <- 0.20
Data <- makeData(p,n,k,sigma,missing)
X <- Data$Missing
Orig <- Data$Orig
truth <- Data$truth

kpod_result <- kpod(X,k)
kpodclusters <- kpod_result$cluster

# }

Run the code above in your browser using DataLab