Tucker_model: Factorization object for 3D Tucker models.

Description Usage Format Members Methods Examples

Description

Tucker_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 Tucker_model object it will be populated with default values and empty matrices. To initialize a Tucker_model call the initialize() method.

Usage

1

Format

An R6Class generator object

Members

iter

Integer showing the number of iterations that have been run on this object.

early.stop

Stop if the lower bound increases by less than this value.

lower.bnd

Vector storing the lower bound values during training.

RMSE

Vector of the root mean squared error of the predictions during training.

H.RMSE

vector of the root mean squared error of predictions made by multiplying the H matrices.

exp.var

Vector of the explained variance of predictions during training.

p.cor

Vector of the Pearson correlation of predictions during training.

s.cor

Vector of the Spearman correlation of predictions during training.

times

Vector of the time taken for each update iteration.

core.mean

Mean parameters of the q Gaussian distributions in the core tensor.

core.var

Variance parameters of the q Gaussian distributions in the core tensor.

core.lambda.shape

Prior for the shape parameter of the gamma distribution on the core precision.

core.lambda.scale

Prior for the scale parameter of the gamma distribution on the core precision.

resp

array storing the predicted response tensor.

delta

binary array indicating whether the response is observed.

core.var

variance parameters of the q Gaussian distributions in the core tensor.

m1Xm1X

Product of mode1.X with itself stored to avoid recalculating.

m2Xm2X

Product of mode2.X with itself stored to avoid recalculating.

m3Xm3X

Product of mode3.X with itself stored to avoid recalculating.

mode1.lambda.shape

Matrix storing the shape parameters for the gamma distributions on the mode 1 projection (A) matrix.

mode1.lambda.scale

Matrix storing the scale parameters for the gamma distributions on the mode 1 projection (A) matrix.

mode2.lambda.shape

Matrix storing the shape parameters for the gamma distributions on the mode 2 projection (A) matrix.

mode2.lambda.scale

Matrix storing the scale parameters for the gamma distributions on the mode 2 projection (A) matrix.

mode3.lambda.shape

Matrix storing the shape parameters for the gamma distributions on the mode 3 projection (A) matrix.

mode3.lambda.scale

Matrix storing the scale parameters for the gamma distributions on the mode 3 projection (A) matrix.

mode1.A.mean

Matrix storing the mean parameters for the normal distributions on the mode 1 projection (A) matrix.

mode1.A.cov

Array storing the covariance parameters for the normal distributions on the mode 1 projection (A) matrix.

mode2.A.mean

Matrix storing the mean parameters for the normal distributions on the mode 2 projection (A) matrix.

mode2.A.cov

Array storing the covariance parameters for the normal distributions on the mode 2 projection (A) matrix.

mode3.A.mean

Matrix storing the mean parameters for the normal distributions on the mode 3 projection (A) matrix.

mode3.A.cov

Array storing the covariance parameters for the normal distributions on the mode 3 projection (A) matrix.

mode1.H.mean

Matrix storing the mean parameters for the normal distributions on the mode 1 latent (H) matrix.

mode1.H.var

Matrix storing the variance parameters for the normal distributions on the mode 1 latent (H) matrix.

mode2.H.mean

Matrix storing the mean parameters for the normal distributions on the mode 2 latent (H) matrix.

mode2.H.var

Matrix storing the variance parameters for the normal distributions on the mode 2 latent (H) matrix.

mode3.H.mean

Matrix storing the mean parameters for the normal distributions on the mode 3 latent (H) matrix.

mode3.H.var

Matrix storing the variance parameters for the normal distributions on the mode 3 latent (H) matrix.

sigma2

Variance for the response tensor.

m1.sigma

Variance for the mode 1 latent (H) matrix.

m2.sigma

Variance for the mode 2 latent (H) matrix.

m3.sigma

Variance for the mode 3 latent (H) matrix.

m1.alpha

Prior shape parameter for the gamma distribution on the precision of the mode 1 projection (A) matrix.

m1.beta

Prior scale paramet for the gamma distribution on the precision of the mode 1 projection (A) matrix.

m2.alpha

Prior shape parameter for the gamma distribution on the precision of the mode 2 projection (A) matrix.

m2.beta

Prior scale paramet for the gamma distribution on the precision of the mode 2 projection (A) matrix.

m3.alpha

Prior shape parameter for the gamma distribution on the precision of the mode 3 projection (A) matrix.

m3.beta

Prior scale paramet for the gamma distribution on the precision of the mode 3 projection (A) matrix.

core.alpha

Prior shape parameter for the gamma distribution on the precision of the core tensor.

core.beta

Prior scale parameter for the gamma distribution on the precision of the core tensor.

core.0D.alpha

Prior shape parameter for the gamma distribution on the precision of the 0D subset of the core tensor.

core.0D.beta

Prior scale parameter for the gamma distribution on the precision of the 0D subset of the core tensor.

core.1D.alpha

Prior shape parameter for the gamma distribution on the precision of the 1D subset of the core tensor.

core.1D.beta

Prior scale parameter for the gamma distribution on the precision of the 1D subset of the core tensor.

core.2D.alpha

Prior shape parameter for the gamma distribution on the precision of the 2D subset of the core tensor.

core.2D.beta

Prior scale parameter for the gamma distribution on the precision of the 2D subset of the core tensor.

core.3D.alpha

Prior shape parameter for the gamma distribution on the precision of the 3D subset of the core tensor.

core.3D.beta

Prior scale parameter for the gamma distribution on the precision of the 3D subset of the core tensor.

Methods

new(data, params)

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

rand_init(params)

Initializes the Tucker_model with random values accoring to params.

Examples

1
2
3
4
5
6
7
8
9
data.params <- get_data_params(c('decomp=Tucker'))
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=Tucker'))
toy.model <- mk_model(train.data, model.params)
toy.model$rand_init(model.params)

nathanlazar/BaTFLED3D documentation built on May 23, 2019, 12:19 p.m.