Learn R Programming

joinet (version 1.0.0)

predict.joinet: Make Predictions

Description

Predicts outcome from features with stacked model.

Usage

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

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).

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)

Examples

Run this code
# \dontshow{
if(!grepl('SunOS',Sys.info()['sysname'])){
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)}# }
if (FALSE) {
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