Learn R Programming

hmlasso (version 0.0.1)

predict.hmlasso: Predict responses

Description

Predict responses

Usage

# S3 method for 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

Run this code
# NOT RUN {
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)

# }

Run the code above in your browser using DataLab