E_step_multi: E step with multiple cluster

View source: R/functions_EM_helper.R

E_step_multiR Documentation

E step with multiple cluster

Description

E step of the EM algorithm with multiple clusters it has to take .D_train (labeled documents) too because for negative label documents, we have to estimate cluster probability TO BE UPDATED

Usage

E_step_multi(
  .C_train,
  .D_train,
  .D_test,
  .X_c = NA,
  .X_b = NA,
  .class_prob,
  .word_prob,
  .mu = NA,
  .psi = NA,
  .sig = NA
)

Arguments

.D_test

document term matrix for the test data

.class_prob

log of the class probability

.word_prob

log of the word probability

.mu

log of continuous metadata probability

.psi

log of binary metadata probability

.C_train:

class matrix of the training data

.D_train:

document term matrix of the training data

Value

a matrix of the log probability of each doc having each class dimension is length(D_test) by 2 Vectorize matrices, stack them, apply logsumexp, then reshape into matrix form.


activetext/activeR documentation built on May 31, 2024, 10:21 a.m.