predict.LogisticR {MethylIT}R Documentation

Predict function for logistic regression model from 'LogisticR' class

Description

Predict using a logistic model obtained from the output of function evaluateDIMPclass.

Usage

## S3 method for class 'LogisticR'
predict(object, newdata = NULL, type = c("all",
  "class", "posterior"), num.cores = 1L, tasks = 0L, ...)

Arguments

object

To use with function 'predict'. An object from 'LogisticR' class. A logistic model given by function evaluateDIMPclass.

newdata

To use with function 'predict'. New data for classification prediction. Optionally, an object from class "GRanges", a list of GRanges, "pDMP" or "InfDIv", in which to look for variables with which to predict. If omitted, the fitted linear predictors are used.

type

The type of output required. Possible outputs are: 'class', "posterior" and "all". The default is "all".

num.cores, tasks

Paramaters for parallele computation using package BiocParallel-package: the number of cores to use, i.e. at most how many child processes will be run simultaneously (see bplapply and the number of tasks per job (only for Linux OS).

...

Not in use.

Details

This function is specific for predictions based on a logistic model given by function evaluateDIMPclass. A logistic model is obtained with 'glm' regression can be used directly with function 'predict' from 'stats' package.

Value

If type is set to 'all', then the original 'newdata' with two columns added, predicted classes and 'posterior' probabilities, in the meta-columns of each GRange object are given. If 'newdata' is null, then the predictions given for the model by function predict.glm are returned. if type is set to 'class' or to "posterior", then the unlisted predited classification or posterior classification probabilities are returned.


[Package MethylIT version 0.3.1 ]