EMLasso.1l: Fit EMLasso for 1 lambda

Description Usage Arguments Value Author(s) References Examples

View source: R/EMLasso.1l.R

Description

Fit EMLasso for 1 lambda

Usage

1
2
3
4
5
6
7
8
  EMLasso.1l(ds, out, lambda, nrOfSamplesPerMDRow = 10,
    rowsToUseForFit = seq(nrow(ds)),
    firstTimeCompleter = marginalCompleter(),
    imputeDs2FitDsProperties = normalImputationConversion(),
    fitPredictor = GLoMo, family = "binomial",
    convergenceChecker = convergenceCheckCreator(),
    postProcess = postProcessEMLasso1l, verbosity = 0,
    extraLog = function(...) { })

Arguments

ds

dataset (numdfr or data.frame) to fit it to

out

outcome vector

lambda

the single lambda

nrOfSamplesPerMDRow

For rows with missing data, how many rows to sample. Defaults to 10.

rowsToUseForFit

Which of the rows of dfr/out can be used for fitting the LASSO (int vector). Defaults to all rows.

firstTimeCompleter

object supported by completeMarginal or of similar form that will complete the dataset the first time. Defaults to marginalCompleter with default parameters.

imputeDs2FitDsProperties

see imputeDs2FitDs object that will provide the conversion from imputed dataset to one that is ready for fitting the predictor model

fitPredictor

function that will perform the predictor model fit. Defaults to GLoMo and should be of this signature.

family

see glmnet. Defaults to "binomial" (i.e. lasso penalized logistic regression).

convergenceChecker

function that will check based on the coefficients over the repeats whether convergence has been achieved. Defaults to convergenceCheckCreator(), so a wrapper around checkConvergence.glmnet. The function should have parameters coefs and verbosity=0

postProcess

function, like postProcessEMLasso1l (its default) and of that signature, to do some extra work before returning the result of EMLasso.1l

verbosity

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

extraLog

A function (by default one that does nothing) that will be used in each iteration to perform extra logging

Value

An object of class EMLasso1l. This is a list with the following items:

Author(s)

Nick Sabbe nick.sabbe@ugent.be

References

[PENDING]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
aDfr<-generateTypicalIndependentDfr(numCat=10, numCnt=10, numObs=100, catProbs=rep(1/3,3),
rcnt=typicalRandomNorm, doShuffle=TRUE, verbosity=1)

outlins<- -mean(aDfr$cnt1)+aDfr$cnt1+2*(aDfr$cat1=="b")
outprobs<-expit(outlins)
y<-factor(sapply(outprobs, function(prob){sample(c("no", "yes"), 1, prob=c(1-prob,prob))}))

aDfr.MD<-randomNA(aDfr, 0.01, verbosity=1)
rlh<-findReasonableLambdaHelper(aDfr, y, verbosity=10)
aLam<-rlh$regionDfr[2,"lambda"]
emlfit1<-EMLasso.1l(aDfr.MD, y, lambda=aLam, nrOfSamplesPerMDRow=7,
	convergenceChecker=convergenceCheckCreator(minIt=5, maxIt=10), verbosity=10)

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