fit.glmnet: Tailormade weighted fitting of logistic glmnet

Description Usage Arguments Value Author(s) See Also Examples

View source: R/fit.glmnet.R

Description

Do dummy coding on dataset and fit logistic (crossvalidated) glmnet

Usage

1
2
3
4
5
  fit.glmnet(ds, out, lambda,
    weights = (rep(1, dim(ds)[1])), verbosity = 0,
    standardize = FALSE, type.measure = NULL,
    imputeDs2FitDsProperties = normalImputationConversion(),
    family = "binomial", ..., reRestrictIfRelevant = TRUE)

Arguments

ds

dataset (numdfr or data.frame)

out

outcome vector

lambda

(single) lambda to use

weights

weight vector per observation (does not have to sum to 1, and defaults to equal weights)

verbosity

The higher this value, the more levels of progress and debug information is displayed (note: in R for Windows, turn off buffered output)

standardize

if TRUE (NOT the default), all variables are standardized before fitting.

type.measure

one of the crossvalidating measures provided by cv.glmnet or NULL (default) to not do crossvalidation

imputeDs2FitDsProperties

see imputeDs2FitDs and EMLasso

family

see glmnet. Defaults to binomial (logistic regression)

...

passed on to glmnet or cv.glmnet.

reRestrictIfRelevant

cv.glmnetdoes not support passng a single lambda value. If this was requested, a dummy extra lambda is added. When this value is TRUE (default), the results are afterwards restricted to the original lambda.

Value

depending on type.measure being NULL, a glmnet or cv.glmnet object.

Author(s)

Nick Sabbe nick.sabbe@ugent.be

See Also

glmnet, imputeDs2FitDs, EMLasso

Examples

1
2
3
y<-rbinom(nrow(iris), 1, 0.5)
lnet<-fit.glmnet(iris, y, lambda=0.05, weights=runif(nrow(iris)), verbosity=1)
cv.lnet<-fit.glmnet(iris, y, lambda=0.05, weights=runif(nrow(iris)), verbosity=1, type.measure="auc")

EMLasso documentation built on May 2, 2019, 5:49 p.m.