Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

predict.MTPS

Make predictions from a "MTPS" model


Description

This function makes predictions from a revised stacking model.

Usage

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

Arguments

object

A fitted object from "MTPS"

newdata

Matrix of new predictors at which predictions are to be made

...

additional arguments affecting the predictions produced

Value

The predicted value from new predictors.

Examples

data("HIV")
set.seed(1)
xmat <- as.matrix(XX)
ymat <- as.matrix(YY)
id <- createFolds(rowMeans(XX), k=5, list=FALSE)
training.id <- id != 1
y.train <- ymat[training.id, ]
y.test  <- ymat[!training.id, ]
x.train <- xmat[training.id, ]
x.test  <- xmat[!training.id, ]
# Cross-Validation Residual Stacking
fit.rs <- MTPS(xmat = x.train, ymat = y.train,
  family = "gaussian",cv = FALSE, residual = TRUE,
  method.step1 = rpart1, method.step2 = lm1)
pred.rs <- predict(fit.rs, x.test)

MTPS

Multi-Task Prediction using Stacking Algorithms

v1.0.1
GPL (>= 2)
Authors
Li Xing [aut, cre], Yuying Huang [aut], Peijie Xie [ctb], Mary Lesperance [aut], Xuekui Zhang [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.