predict.hmlasso: Predict responses

Description Usage Arguments Examples

View source: R/predictor.R

Description

Predict responses

Usage

1
2
3
## S3 method for class 'hmlasso'
predict(object, newx, s = NULL,
  impute_method = "mean", adjust_by_tr = FALSE, ...)

Arguments

object

hmlasso model

newx

matrix of explanatory variables

s

selected lambda (default: all)

impute_method

imputation method for predictions (default: "mean")

adjust_by_tr

whether mean (or median) of training data for prediction is used or not

...

parameters of predict function

Examples

1
2
3
4
5
6
X_incompl <- as.matrix(iris[, 1:3])
X_incompl[1:5,1] <- NA
X_incompl[6:10,2] <- NA
y <- iris[, 4]
cv_fit <- cv.hmlasso(X_incompl, y, nlambda=50, lambda.min.ratio=1e-2)
predict(cv_fit$fit, X_incompl)

hmlasso documentation built on Aug. 3, 2019, 9:03 a.m.