eValidation: Validate an E2Tree Model via Proximity Matrix Comparison

View source: R/eValidation.R

eValidationR Documentation

Validate an E2Tree Model via Proximity Matrix Comparison

Description

Compares the ensemble proximity matrix with the E2Tree-estimated proximity matrix using multiple divergence and similarity measures. Can perform the Mantel test, permutation tests on divergence/similarity measures (nLoI, Hellinger, wRMSE, RV, SSIM), or both.

Usage

eValidation(
  data,
  fit,
  D,
  test = c("both", "mantel", "measures"),
  graph = TRUE,
  n_perm = 999,
  conf.level = 0.95,
  seed = NULL
)

Arguments

data

A data frame containing the variables in the model.

fit

An e2tree object.

D

The dissimilarity matrix obtained with createDisMatrix.

test

Character string specifying which tests to perform. One of "both" (default), "mantel" (Mantel test only), or "measures" (divergence/similarity measures with permutation tests only).

graph

Logical (default TRUE). If TRUE, heatmaps are displayed.

n_perm

Integer. Number of permutations for the permutation test on measures. Default is 999. Set to 0 to skip permutation testing. Ignored when test = "mantel".

conf.level

Numeric. Confidence level for intervals. Default is 0.95.

seed

Integer or NULL. Random seed for reproducibility.

Value

An object of class "eValidation" containing:

Proximity_matrix_ensemble

Ensemble proximity matrix (reordered)

Proximity_matrix_e2tree

E2Tree proximity matrix (reordered)

mantel_test

Mantel test result (NULL if test = "measures")

loi

LoI object with decomposition (NULL if test = "mantel")

measures

Data frame with all measures (NULL if test = "mantel")

permutation

Permutation test results for measures (if applicable)

Examples


## Classification:
data(iris)
smp_size <- floor(0.75 * nrow(iris))
train_ind <- sample(seq_len(nrow(iris)), size = smp_size)
training <- iris[train_ind, ]

ensemble <- randomForest::randomForest(Species ~ ., data=training,
  importance=TRUE, proximity=TRUE)

D <- createDisMatrix(ensemble, data=training, label = "Species",
  parallel = list(active=FALSE, no_cores = 1))

setting <- list(impTotal=0.1, maxDec=0.01, n=2, level=5)
tree <- e2tree(Species ~ ., training, D, ensemble, setting)

val <- eValidation(training, tree, D, n_perm = 199)
print(val)
summary(val)
plot(val)



e2tree documentation built on May 15, 2026, 5:06 p.m.