predict.lcm_tree: approximate predictive class probabilities for a new...

View source: R/predict.R

predict.lcm_treeR Documentation

approximate predictive class probabilities for a new observation in a leaf

Description

approximate predictive class probabilities for a new observation in a leaf

Usage

## S3 method for class 'lcm_tree'
predict(object, dat_pred = NULL, leaf_ids = NULL, collapsed = TRUE, ...)

Arguments

object

An lcm_tree class object; Output from lcm_tree()

dat_pred

a binary matrix with rows for observations and columns for features (of the same dimension as in the training data)

leaf_ids

a vector of character strings, each being the name of the leaf name for that observation

collapsed

default to TRUE; if FALSE, no posterior median model selection is done - so each leaf may have its own vector of latent class proportions.

...

Other parameters

Value

a matrix with the same number of rows as dat_pred and K columns (K is the number of latent classes); each row correspond to a vector of predicted probabilities of an observation in each class.


zhenkewu/lotR documentation built on April 24, 2022, 2:36 a.m.