Learn R Programming

joinet (version 0.0.3)

predict.joinet: Make Predictions

Description

Predicts outcome from features with stacked model.

Usage

# S3 method for 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

Run this code
# NOT RUN {
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)

# }

Run the code above in your browser using DataLab