rfc: Build a random forest classifier

View source: R/MPMutils.R

rfcR Documentation

Build a random forest classifier

Description

Wrapper for the GenerateLearningsets classification functions.

Usage

rfc(data, status, k = 5, method = "CV", ...)

Arguments

data

An (n, m) matrix or data.frame with no outcome attribute.

status

A vector of length n, containing the outcome.

k

number of cross-validation iterations (default = 5).

method

One of the GenerateLearningsets methods, including: "LOOCV", "CV", "MCCV", and "bootstrap" (default = "CV").

...

Currently ignored.

Value

A list of objects of class "cloutput" and "clvarseloutput", respectively.

Author(s)

Fernando Palluzzi fernando.palluzzi@gmail.com

References

Slawski M, Daumer M, Boulesteix AL. CMA - a comprehensive Bioconductor package for supervised classification with high dimensional data. BMC Bioinformatics 9, 439 (2008). <https://doi.org/10.1186/1471-2105-9-439>

See Also

See us.predict to launch all morphonode modules at once. See also topsim for a simple similarity search.

Examples

# Extract a subset of 300 subjects and an outcome vector of length 30 
# from the default simulated dataset

x <- mosaic::sample(mpm.us, 300, replace = FALSE, prob = NULL)
y <- x$y
x <- x[, 2:15]
dim(x)
length(y)

# Build a 5-fold cross-validation object

CV <- rfc(x, status = y)

# Performances of the first of five predictors

CV1 <- CV[[1]]
P <- performance(obs = CV1@y, pred = CV1@yhat)
print(P)


Morphonodepredictivemodel/morphonode documentation built on Feb. 15, 2023, 4:51 a.m.