fit_lasso_poly {drape}R Documentation

Fit a lasso regression using quadratic polynomial basis, with interactions.

Description

Compute regression function and derivative estimates based on polynomial basis lasso with penalty parameter chosen by cross validation (CV).

Usage

fit_lasso_poly(X, y, degree, lambda = NULL)

Arguments

X

matrix of covariates.

y

vector of responses.

degree

maximum degree of polynomial terms.

lambda

optional scalar tuning parameter, if "NULL" chosen via cross-validation.

Value

List containing: A function "fit" which takes matrix input of the same width as X, and returns a vector of y-predictions. A scalar "lambda" the tuning parameter.


[Package drape version 0.0.1 Index]