test_CP: Perform 'cold start' prediction using BaTFLED algorthm for CP...

Description Usage Arguments Value Examples

View source: R/test_CP.R

Description

Perform 'cold start' prediction using BaTFLED algorthm for CP models

Usage

1
test_CP(d, m)

Arguments

d

an input data object created with input_data

m

a CP_model object created with mk_model

Value

Response tensor generated by multiplying the input data through the trained model

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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)

train(d=train.data, m=toy.model, new.iter=1, params=model.params)

resp <- test_CP(train.data, toy.model)

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