predict.cornet: Predict binary outcome

View source: R/functions.R

predict.cornetR Documentation

Predict binary outcome

Description

Predicts the binary outcome with linear, logistic, and combined regression.

Usage

## S3 method for class 'cornet'
predict(object, newx, type = "probability", ...)

Arguments

object

cornet object

newx

covariates: numeric matrix with n rows (samples) and p columns (variables)

type

"probability", "odds", "log-odds"

...

further arguments (not applicable)

Details

For linear regression, this function tentatively transforms the predicted values to predicted probabilities, using a Gaussian distribution with a fixed mean (threshold) and a fixed variance (estimated variance of the numeric outcome).

Examples

n <- 100; p <- 200
y <- rnorm(n)
X <- matrix(rnorm(n*p),nrow=n,ncol=p)
net <- cornet(y=y,cutoff=0,X=X)
predict(net,newx=X)


rauschenberger/colasso documentation built on Aug. 15, 2023, 3:09 a.m.