predict.multiFit: Make predictions for multiple outcomes

View source: R/multiFit.R

predict.multiFitR Documentation

Make predictions for multiple outcomes

Description

This function makes predictions from a multiFit object.

Usage

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

Arguments

object

A fitted object from "multiFit"

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, ]
fit <- multiFit(xmat = x.train, ymat = y.train,
                method = rpart1, family = "gaussian")
predict(fit, x.test)

MTPS documentation built on July 9, 2023, 7:46 p.m.