predict.cornet: Predict binary outcome

Description Usage Arguments Details Examples

View source: R/functions.R

Description

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

Usage

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

1
2
3
4
5
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)

cornet documentation built on April 19, 2021, 9:07 a.m.