predict.tandem: Creates a prediction using a tandem-object

Description Usage Arguments Value Examples

View source: R/functions.R

Description

Creates a prediction using a tandem-object.

Usage

1
2
## S3 method for class 'tandem'
predict(object, newx, ...)

Arguments

object

A tandem-object, as returned by tandem()

newx

A feature matrix, where the rows correspond to samples and the columns to features.

...

Not used. Other arguments for predict().

Value

The predicted response vector.

Examples

1
2
3
4
5
6
7
8
9
# unpack example data
x = example_data$x
y = example_data$y
upstream = example_data$upstream

# fit a tandem model, determine the coefficients and create a prediction
fit = tandem(x, y, upstream, alpha=0.5)
beta = coef(fit)
y_hat = predict(fit, newx=x)

TANDEM documentation built on Dec. 1, 2019, 1:12 a.m.