MVSF.test: Multivariate Structure and Flexibility Test

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/MVSF.test.R

Description

Test the multivariate structure of your data against an empirical null model and the flexibility of your model to correctly classify new observations created by smoothing the classes.

Usage

1
MVSF.test(target, predictors, nMC = 999)

Arguments

target

Vector or target Column with names of classes.

predictors

Dataframe or matrix with predictor variables.

nMC

Number of smoothed observations returned per class (default = 999)

Details

Multivariate Test: The observed OOB is compared against an empirical null model with no multivariate structure. The null model is created by shuffling the lables of the classes nMC times and keeping the OOB of each class under the null model. A Pseudo P-value is returned as P = r/nMC-1, with r = the number of times that the null model OOB >= trained OOB, and nMC = number of Monte Carlo simulations.

Flexibility test: Create nMC of each class observations smoothing the classes and predict using the trained model. Return error rate as n/nMC, with n = total number of missclassifications and nMC = number of Monte Carlo simulations. prop.test is used for testing the null that trained OOB error = error of the smoothed observations

A plot method is available

Value

An object of class MVSF. Dataframe with results of multivariate test and flexibility test.

oob.err

OOB of trained model

null.err

mean OOB of null model

P.null

Pseudo P value, probability that trained OOB can happen by random

q05.null

0.5 quantile of the ecdf of the null error

q95.null

0.95 quantile of the ecdf of the null error

smooth.err

prediction error rate of the smoothed classes

p.smooth

p value of prop.test, probability that the trained error and the prediction error of smoothed classes are the same

Author(s)

Pedro Martinez Arbizu & Sven Rossel

References

Rossel, S. & P. Martinez Arbizu (2018) Automatic specimen identification of Harpacticoids (Crustacea:Copepoda) using Random Forest and MALDIā€TOF mass spectra, including a post hoc test for false positive discovery. Methods in Ecology and Evolution, 9(6):1421-1434.

https://doi.org/10.1111/2041-210X.13000

See Also

plot.MVSF robust.test

Examples

1
2
3
4
data(iris)
MVSF.iris <- MVSF.test(iris$Species,iris[,1:4],nMC=99)
print(MVSF.iris)
plot(MVSF.iris)

pmartinezarbizu/RFtools documentation built on March 10, 2021, 12:11 p.m.