fits a regularized regressoion model using the glmnet package.
name |
brief model name as character |
description |
character description describing the model |
overwrite |
should model be overwriiten if it already exists? |
newdata |
data.frame of independent variables. Default is to use the binned data. |
y |
target to fit the data to. Default is the y variable used for discretization. |
w |
optional weight variable |
nfolds |
number of k-folds with which to select the optimal lambda value |
upper.limits |
maximum value of fitted coefficients |
lower.limits |
minimimum value of fitted coefficients |
alpha |
type of regularization. Default is alpha == 1 for LASSO regression. Alpha of 0 is Ridge regression while anythin in between is the elastic net mixture. |
family |
response variable distribution. Default is "binomial". |
... |
additional arguments passed on to cv.glmnet |
the fit function first calls predict and substitutes the
weight-of-evidence for all predictor variables. It then passes this matrix
on to cv.glmnet
. The coefficients of a binner model fit
are restricted to [0,3]. This ensures there are no sign flips in the
model coefficients and that the relationships observed on margin are
retained in the final model.
bin
wrapper function.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.