predict.prioritylasso {prioritylasso} | R Documentation |
Predictions from prioritylasso
Description
Makes predictions for a prioritylasso
object. It can be chosen between linear predictors or fitted values.
Usage
## S3 method for class 'prioritylasso'
predict(
object,
newdata = NULL,
type = c("link", "response"),
handle.missingtestdata = c("none", "omit.prediction", "set.zero", "impute.block"),
include.allintercepts = FALSE,
use.blocks = "all",
...
)
Arguments
object |
An object of class |
newdata |
(nnew |
type |
Specifies the type of predictions. |
handle.missingtestdata |
Specifies how to deal with missing data in the test data; possibilities are |
include.allintercepts |
should the intercepts from all blocks included in the prediction? If |
use.blocks |
determines which blocks are used for the prediction, the default is all. Otherwise one can specify the number of blocks which are used in a vector |
... |
Further arguments passed to or from other methods. |
Details
handle.missingtestdata
specifies how to deal with missing data.
The default none
cannot handle missing data, omit.prediction
does not make a prediction for observations with missing values and return NA
. set.zero
ignores
the missing data for the calculation of the prediction (the missing value is set to zero).
impute.block
uses an imputation model to impute the offset of a missing block. This only works if the prioritylasso object was fitted with handle.missingdata = "impute.offset"
.
If impute.offset.cases = "complete.cases"
was used, then every observation can have only one missing block. For observations with more than one missing block, NA
is returned.
If impute.offset.cases = "available.cases"
was used, the missingness pattern in the test data has to be the same as in the train data. For observations with an unknown missingness pattern, NA
is returned.
Value
Predictions that depend on type
.
Author(s)
Simon Klau
See Also
Examples
pl_bin <- prioritylasso(X = matrix(rnorm(50*190),50,190), Y = rbinom(50,1,0.5),
family = "binomial", type.measure = "auc",
blocks = list(block1=1:13,block2=14:80, block3=81:190),
block1.penalization = TRUE, lambda.type = "lambda.min",
standardize = FALSE, nfolds = 3)
newdata_bin <- matrix(rnorm(10*190),10,190)
predict(object = pl_bin, newdata = newdata_bin, type = "response")