ipflasso.predict: Using an IPF-lasso model for prediction of new observations

Description Usage Arguments Value Author(s) References Examples

View source: R/ipflasso.predict.r

Description

Derives predictions for new observations from a model fitted by the functions cvr.ipflasso or cvr2.ipflasso.

Usage

1
ipflasso.predict(object, Xtest)

Arguments

object

the output of either cvr.ipflasso (if the user chooses the penalty factor himself) or cvr2.ipflasso (if the user cross-validates the penalty factor).

Xtest

a ntest x p matrix containing the values of the predictors for the test data. It should have the same number of columns as the matrix X used to obtain the model result.

Value

A list with the following arguments:

linpredtest

a ntest-vector giving the value of the linear predictor for the test observations

classtest

a ntest-vector with values 0 or 1 giving the predicted class for the test observations (for binary Y).

probabilitiestest

a ntest-vector giving the predicted probability of Y=1 for the test observations (for binary Y).

Author(s)

Anne-Laure Boulesteix (https://www.en.ibe.med.uni-muenchen.de/mitarbeiter/professoren/boulesteix/index.html)

References

Boulesteix AL, De Bin R, Jiang X, Fuchs M, 2017. IPF-lasso: integrative L1-penalized regression with penalty factors for prediction based on multi-omics data. Comput Math Methods Med 2017:7691937.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# load ipflasso library
library(ipflasso)

# generate dummy data
X<-matrix(rnorm(50*200),50,200)
Xtest<-matrix(rnorm(20*200),20,200)
Y<-rbinom(50,1,0.5)

# fitting the IPF-lasso model
model1<-cvr.ipflasso(X=X,Y=Y,family="binomial",standardize=FALSE,
                    blocks=list(block1=1:50,block2=51:200),
                    pf=c(1,2),nfolds=5,ncv=10,type.measure="class")

# making predictions from Xtest
ipflasso.predict(object=model1,Xtest=Xtest)

Example output

Loading required package: glmnet
Loading required package: Matrix
Loaded glmnet 4.0-2
Loading required package: survival
$linpredtest
             [,1]
 [1,] -0.32776404
 [2,]  1.36123171
 [3,] -0.93901377
 [4,]  0.07833517
 [5,] -1.48271709
 [6,] -1.76022769
 [7,] -0.33333557
 [8,]  0.33650086
 [9,]  0.44098803
[10,] -2.04938384
[11,] -0.94771724
[12,]  2.55976268
[13,]  1.27367445
[14,] -2.10484047
[15,]  2.06697682
[16,] -0.74209464
[17,]  1.21026508
[18,]  0.75646721
[19,]  0.29506982
[20,] -0.27209049

$classtest
 [1] 0 1 0 1 0 0 0 1 1 0 0 1 1 0 1 0 1 1 1 0

$probabilitiestest
 [1] 0.4187848 0.7959598 0.2810996 0.5195738 0.1850174 0.1467618 0.4174293
 [8] 0.5833403 0.6084944 0.1141147 0.2793441 0.9282266 0.7813711 0.1086272
[15] 0.8876518 0.3225463 0.7703458 0.6805862 0.5732369 0.4323940

ipflasso documentation built on Dec. 10, 2019, 5:06 p.m.