predict.DPR_Model {RcppDPR}R Documentation

Use a DPR model to predict results from new data

Description

Use a DPR model to predict results from new data

Usage

## S3 method for class 'DPR_Model'
predict(object, newdata, ...)

Arguments

object

an object of class DPR_Model

newdata

Numeric matrix representing the input to the model

...

ignored args.

Value

returns Numeric vector of predictions

Examples

n <- 500
p <- 10775
file_path_x <- system.file("extdata", "data/in/x.rds", package = "RcppDPR")
file_path_y <- system.file("extdata", "data/in/y.rds", package = "RcppDPR")
file_path_w <- system.file("extdata", "data/in/w.rds", package = "RcppDPR")
x = readRDS(file_path_x)
y = readRDS(file_path_y)
w = readRDS(file_path_w)
dpr_model <- fit_model(y, w, x, fitting_method = "VB")
new_x <- matrix(rnorm(n = n * p, mean = 0, sd = 1), nrow = n, ncol = p)
new_y <- predict(dpr_model, new_x)

[Package RcppDPR version 0.1.10 Index]