kppInit: kppInit

Description Usage Arguments Author(s) References Examples

View source: R/kppInit.R

Description

Performs k++ with semi-supervision

Usage

1
2
3
4
5
kppInit(data,
                    numGroups,
                    knownLabels=NULL,
                    trueLabels=NULL
                    )

Arguments

data

data

knownLabels

vector of indices of rows of x whose labels are known

trueLabels

length nrow(x) vector of true labels (only trueLabels[knownLabels] matter)

numGroups

number of clsuters considered

Author(s)

Jordan Yoder

References

http://www.stat.washington.edu/mclust/

Examples

1
2
3
4
5
6
7
8
data = matrix(runif(20),nrow=10,ncol=2)
library(ssClust)
centers = kppInit(data, numGroups=3, 
knownLabels=c(1,2), trueLabels=c(1,0)) #note trueLabels are 0-indexed


all(centers[[1]]==data[2,]) #center 1 must be data2 because the true label of 2 is 0
all(centers[[2]]==data[1,]) #center 2 must be data1 because the true label of 1 is 1

Noobivsho/ssClust documentation built on Aug. 10, 2019, 5:47 a.m.