predict.DFNET.forest: Model predictions

View source: R/methods.R

predict.DFNET.forestR Documentation

Model predictions

Description

Uses a DFNET.forest to run predictions on data.

Usage

## S3 method for class 'DFNET.forest'
predict(object, data, ...)

Arguments

object

The DFNET.forest to use for prediction.

data

matrix or 3D array. The data to run predictions on.

...

arguments to be passed to or from other methods.

Value

A list with members

predictions

the predicted classes

approval.rate

the relative number of decision trees that predicted the given class.

participation.rate

the relative number of decision trees that voted at all (i.e. did not predict NaN or NA)

.

Examples

## Not run: 
smp_size <- floor(0.80 * dim(features)[1])
train_ids <- sample(dim(features)[1], size = smp_size)
test_ids <- (1:dim(features)[1])[-train_ids]
forest <- DFNET_init(graph, features[train_ids, ])
# train ...
prediction <- predict(forest, features[test_ids, ])

## End(Not run)

pievos101/DFNET documentation built on Dec. 1, 2022, 3:44 p.m.