initialize_Y: Clustering initialization

Description Usage Arguments Details Value Examples

View source: R/init_functions.R

Description

Perform a DocumentTermMatrix clustering via default routines or allow for user specified function

Usage

1
initialize_Y(dtm, Q, K, init = "random")

Arguments

dtm

An object of class DocumentTermMatrix

Q

The number of cluster

K

The dimension of the latent space. It is mandatory, for compatibility reasons but not always used (e.g. random do not use it).

init

Either:

  • 'random': Random initialization.

  • 'kmeans_lda': A Q-kmeans on the latent space (theta matrix) of a K-topic LDA.

  • A user defined function which MUST take the following structure for compatibility init <- function(dtm, Q, K, nruns, ...)

Details

For more details see benchmarks-functions

Value

A vector of size equal to the number of row of dtm, containing a Q-clustering

Examples

1
2
3
4
simu = simulate_BBC(N = 100, L = 100)
Q = 6
K = 4
Y = initialize_Y(simu$dtm.full, Q, K, init = 'kmeans_lda')

MoMPCA documentation built on Jan. 21, 2021, 5:09 p.m.