lognetProbabilityReusable: Function to help calculate predicted probability of a lognet...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/lognetProbabilityReusable.R

Description

Method that provides information that can be reused to predict probabilities from the same lognet several times

Usage

1
2
3
  lognetProbabilityReusable(lognet, ds,
    imputeDs2FitDsProperties = normalImputationConversion(),
    usecol, verbosity = 0)

Arguments

lognet

binomial glmnet fit to use for prediction

ds

numdfr or data.frame that holds the structure from which dataset predictions will need to happen.

imputeDs2FitDsProperties

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

usecol

which of the column of beta must be used. Must be provided if lognet is not the result of a 1-lambda glmnet call.

verbosity

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

Value

object of class "lognetProbabilityReusable": list with items:

conversionProps

data.frame with columns fromCols (original column number), newNames (new column name), mustEqual (which value must it equal for this level of the factor), useBeta (coefficient)

originalLognet

lognet that was passed in

usedcol

usecol that was passed in (or 1 if only it was missing)

Author(s)

Nick Sabbe nick.sabbe@ugent.be

See Also

dfrConversionProps

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(iris)
	iris.nd2<-numdfr(iris)
	y2<-rbinom(nrow(iris), 1, 0.5)
	iris.nic2<-normalImputationConversion(
		scalingParams=typicalScaleAndCenter(),
		transformParams=typicalTransformations())
	iris.cp2<-imputeDs2FitDsProps(iris.nic2,iris.nd2,verbosity=1)

	iris.cvtd2<-imputeDs2FitDs(iris.cp2,ds=iris.nd2,verbosity=3)

	lnet<-glmnet(iris.cvtd2, y2, family="binomial")
	lognetProbabilityReusable(lnet, iris.nd2, imputeDs2FitDsProperties=iris.cp2, usecol=5, verbosity=1)

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