Skip to contents

Predicts outcome from features with stacked model.

Usage

# S3 method for class 'joinet'
predict(object, newx, type = "response", ...)

Arguments

object

joinet object

newx

covariates: numeric matrix with \(n\) rows (samples) and \(p\) columns (variables)

type

character "link" or "response"

...

further arguments (not applicable)

Value

This function returns predictions from base and meta learners. The slots base and meta each contain a matrix with \(n\) rows (samples) and \(q\) columns (variables).

Examples

if (FALSE) { # \dontrun{
n <- 50; p <- 100; q <- 3
X <- matrix(rnorm(n*p),nrow=n,ncol=p)
Y <- replicate(n=q,expr=rnorm(n=n,mean=rowSums(X[,1:5])))
Y[,1] <- 1*(Y[,1]>median(Y[,1]))
object <- joinet(Y=Y,X=X,family=c("binomial","gaussian","gaussian"))
predict(object,newx=X)} # }