predict | R Documentation |
This function applies
predict.randomForest
to a 'pDMP' object
provided in the argument newdata
.
predict(object, newdata = NULL, ...)
## S4 method for signature 'RandomForest,GRanges'
predict(
object,
newdata,
type = c("class", "response", "prob", "votes"),
predict.all = FALSE,
keep.data = FALSE,
...
)
## S4 method for signature 'RandomForest,pDMP'
predict(
object,
newdata,
type = c("class", "response", "prob", "votes"),
predict.all = FALSE,
keep.data = FALSE,
num.cores = 1L,
tasks = 0L,
...
)
## S4 method for signature 'randomForestformula,GRanges'
predict(
object,
newdata,
type = c("class", "response", "prob", "votes"),
predict.all = FALSE,
keep.data = FALSE,
...
)
## S4 method for signature 'randomForestformulaList,GRangesList'
predict(
object,
newdata,
type = c("class", "response", "prob", "votes"),
predict.all = FALSE,
keep.data = FALSE,
num.cores = 1L,
tasks = 0L,
...
)
object |
an object of 'RandomForest-class', as that created by the
function |
newdata |
A 'pDMP' object generated with function
|
predict.all, type, ... |
The same as in
|
keep.data |
Logical. Whether to preserve the original class
from object |
num.cores, tasks |
Parameters for parallel computation using package
|
The generic function just call function
predict
from 'stats' R package.
If newdata
is a GRanges-class
, then
'newdata' must be an element of a pDMP-class object, i.e., it must have
the same structure as the GRanges-class elements in a pDMP-class object.
The same results as given by function
predict.randomForest
.
Robersy Sanchez https://genomaths.com
## Load a DMP data set
data(dmps, package = 'MethylIT')
## Let's accomplish the classification by using Random Forest
## algorithm
perf <- evaluateDIMPclass(LR = dmps,
column = c(hdiv = TRUE, TV = TRUE,
wprob = TRUE, pos = TRUE),
classifier = 'random_forest',
n.pc = 4L,
control.names = c('C1', 'C2', 'C3'),
treatment.names = c('T1', 'T2', 'T3'),
center = FALSE,
scale = FALSE,
prop = 0.6)
predict(object = perf$model, newdata = dmps, keep.data = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.