predict.pre {pre} | R Documentation |
Predicted values based on final prediction rule ensemble
Description
predict.pre
generates predictions based on the final prediction rule
ensemble, for training or new (test) observations
Usage
## S3 method for class 'pre'
predict(
object,
newdata = NULL,
type = "link",
penalty.par.val = "lambda.1se",
...
)
Arguments
object |
object of class |
newdata |
optional |
type |
character string. The type of prediction required; the default
|
penalty.par.val |
character or numeric. Value of the penalty parameter
|
... |
further arguments to be passed to
|
Details
If newdata
is not provided, predictions for training data will be
returned.
See Also
pre
, plot.pre
,
coef.pre
, importance.pre
, cvpre
,
interact
, print.pre
,
predict.cv.glmnet
Examples
set.seed(1)
train <- sample(1:sum(complete.cases(airquality)), size = 100)
set.seed(42)
airq.ens <- pre(Ozone ~ ., data = airquality[complete.cases(airquality),][train,])
predict(airq.ens)
predict(airq.ens, newdata = airquality[complete.cases(airquality),][-train,])