predict.joinet: Make Predictions

Description Usage Arguments Value Examples

View source: R/functions.R

Description

Predicts outcome from features with stacked model.

Usage

1
2
## 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

1
2
3
4
5
6
7
8
## 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)
## End(Not run)

joinet documentation built on Aug. 9, 2021, 9:13 a.m.