CP_model: BaTFLED model object for 3-D response tensor with CP...

Description Usage Format Methods See Also Examples

Description

CP_model objects are 'R6' objects so that their values can be updated in place. The object is treated like an environment and components are accessed using the $ operator. When creating a new CP_model object it will be populated with default values and empty matrices. To initialize a CP_model call the initialize() method.

Usage

1

Format

An R6Class generator object

Methods

new(data, params)

Creates a new CP_model object with matrices sized accoring to the matrices in data.

rand_init(params)

Initializes the CP_model with random values accoring to params.

See Also

get_model_params, input_data, Tucker_model

Examples

1
2
3
4
5
6
7
8
9
data.params <- get_data_params(c('decomp=CP'))
toy <- mk_toy(data.params)
train.data <- input_data$new(mode1.X=toy$mode1.X[,-1],
                             mode2.X=toy$mode2.X[,-1],
                             mode3.X=toy$mode3.X[,-1],
                             resp=toy$resp)
model.params <- get_model_params(c('decomp=CP'))
toy.model <- mk_model(train.data, model.params)
toy.model$rand_init(model.params)

BaTFLED3D documentation built on May 2, 2019, 2:38 p.m.