Computational Provenance & Reproducibility Record

RAISINS - R and AI Solutions for INferential Statistics · Online Statistical Analysis Platform for Agricultural Research

Computational Provenance & Reproducibility Record AutoML · 1.0.0 · DOI 10.5281/zenodo.21616658

Computational Provenance & Reproducibility Record

RAISINS · AutoML Module

This Computational Provenance Record documents the analytical computing environment, software dependencies, computational provenance, and bibliographic references associated with the RAISINS AutoML module. It is intended to support computational reproducibility and software transparency. Detailed methodology, and user guidance are provided separately in the official module documentation.

Any issues or updates required please comment here

Go to the App from here

1 Module Metadata

Parameter Specification
Module AutoML
Module Version 1.0.0
DOI 10.5281/zenodo.21616658
Document Type Computational workflow
Analytical Engine R
R Version 4.5.2
Reproducibility Execution Environment: Posit Connect · GCR · renv-locked

2 Analytical Dependency Manifest

Package Version Repository Core Analytical Functions
h2o 3.44.0.3 CRAN h2o.init(), h2o.importFile(), h2o.splitFrame(), h2o.assign(), h2o.automl(), h2o.getModel(), h2o.predict(), h2o.performance(), h2o.auc(), h2o.aucpr(), h2o.logloss(), h2o.rmse(), h2o.mse(), h2o.mae(), h2o.rmsle(), h2o.mean_residual_deviance(), h2o.r2(), h2o.confusionMatrix()
corrplot 0.95 CRAN corrplot(), cor.mtest()
stats 4.5.2 Base R cor(), chisq.test(), kmeans(), cut(), quantile(), aggregate(), sd(), median(), IQR()

3 Analytical Function Registry

Analytical Role Primary Function(s)
Numeric correlation stats::cor(), corrplot::cor.mtest(), corrplot::corrplot()
Categorical association (Cramér’s V) stats::chisq.test() inside the module’s cramers_v() helper (bias-corrected V)
Feature scaling standard_scale_append(), minmax_scale_append(), robust_scale_append(), maxabs_scale_append(), log_scale_append()
Categorical encoding label_encode_append(), frequency_encode_append(), ordinal_encode_append(), binary_encode_append(), onehot_encode_append(), target_encode_append()
Classification / binning equal_width_bin_append(), equal_freq_bin_append(), kmeans_bin_append(), custom_bin_append() (base cut(), quantile(), stats::kmeans())
H2O cluster initialisation h2o::h2o.init()
Data import into H2O h2o::h2o.importFile()
Train / validation / test split h2o::h2o.splitFrame(), h2o::h2o.assign()
Model search h2o::h2o.automl()
Model retrieval & scoring h2o::h2o.getModel(), h2o::h2o.predict()
Model performance metrics h2o::h2o.performance(), h2o.auc(), h2o.aucpr(), h2o.logloss(), h2o.rmse(), h2o.mse(), h2o.mae(), h2o.rmsle(), h2o.mean_residual_deviance(), h2o.r2(), h2o.confusionMatrix()

4 Default Methods & Parameters

Analysis Step / Parameter Default Method / Value
Numeric
Correlation

(cor())
Method pearson
Missing data use = "pairwise.complete.obs"
Eligible columns Numeric columns with non-zero standard deviation and > 1 unique value
Cramér's V
Association

(chisq.test())
Statistic Bias-corrected Cramér's V (Bergsma correction) computed from an uncorrected χ² statistic (correct = FALSE)
Significance overlay p-value matrix; default significance level α = 0.05
Eligible columns Factor / character columns with 2–50 unique levels, and fewer levels than rows
Scaling
(apply_scaling())
Standardisation (Z-score) (x - mean(x)) / sd(x); requires non-zero SD
Min-Max Normalisation Default output range [0, 1]
Robust Scaling (x - median(x)) / IQR(x); requires non-zero IQR
Max-Abs Scaling x / max(abs(x))
Log Transform log(x); auto-shifted by abs(min(x)) + 1 when non-positive values are present
Encoding
(apply_encoding family)
Label as.integer(factor(x)), alphabetical level order
Frequency Category count from table(), NAs counted (useNA = "ifany")
Ordinal User-specified level order via drag-and-drop; alphabetical order if unspecified
Binary Integer level code split into ceiling(log2(n_levels)) bit columns
One-Hot Sorted unique levels; optional drop_first (default off)
Target Smoothed mean encoding; default smoothing = 10; unseen categories fall back to the global mean
Classification /
Binning

(apply_binning())
Equal Width Default number of classes = 4 (slider range 2–10)
Equal Frequency Quantile-based cut points; default number of classes = 4
K-Means Clustering stats::kmeans() with a fixed seed = 123; clusters relabelled in ascending order of centre
Custom Break Points User-supplied, comma-separated break points
H2O Cluster
Initialisation

(h2o.init(), global.R)
Threads nthreads = -1 (use all available cores)
Memory max_mem_size = "3G", min_mem_size = "512m"
H2O Data Import
(h2o.importFile())
Missing values na.strings = ""
Pre-processing Character columns trimmed (trimws()) and re-written to a temporary CSV before import
Train / Validation /
Test Split

(h2o.splitFrame())
Training percentage Default 80% (user-adjustable, 1–100%)
Validation frame Enabled by default; default validation share = 50% of Test data
Split reproducibility Fixed seed = 42
AutoML Model
Search

(h2o.automl())
Model / time budget Default settings: max_models = 50, max_runtime_secs = 300 (5 min); Custom settings: user-adjustable max_models (15–100) and runtime (1–25 min)
Excluded algorithms None by default; user may exclude DeepLearning, StackedEnsemble, XGBoost
Cross-validation Enabled by default with nfolds = 5 (user-adjustable 2–10) when no validation frame is supplied; forced to nfolds = 0 whenever a validation frame is present
Stopping metric AUTO by default
Leaderboard sort metric AUTO by default (resolves to AUC for binary classification, deviance for regression, mean per-class error for multiclass)
Search reproducibility Fixed seed = 42
Model Performance
Metrics

(h2o.performance())
Regression models RMSE, MSE, MAE, RMSLE, Mean Residual Deviance, R²
Classification models AUC, AUCPR, LogLoss, and a full confusion matrix; binary models additionally report threshold-based scores (max_criteria_and_metric_scores)
Evaluation splits Computed separately on Train, Validation (if present), and Test (if present); displayed digits default to 3, user-adjustable 0–4

5 R Code for Key Analytical Steps

The code blocks below demonstrate the exact computation behind each reported result using the mtcars dataset from the datasets package. The same two columns — hp (numeric) and cyl (categorical) — are carried through correlation, scaling, encoding, and binning, mirroring how a user selects one column and moves across the module’s Feature Engineering sections; the transformed frame then feeds directly into the H2O AutoML search on am (transmission type) as a binary target.

5.1 Numeric Correlation & Categorical Association

data(mtcars)

mtcars$cyl <- factor(mtcars$cyl)
mtcars$am  <- factor(mtcars$am)

## Numeric correlation (Pearson, pairwise-complete) --------------------------
num_cols <- c("mpg", "disp", "hp", "wt", "qsec")
M     <- cor(mtcars[, num_cols], use = "pairwise.complete.obs", method = "pearson")
p_mat <- corrplot::cor.mtest(mtcars[, num_cols], method = "pearson")$p
corrplot::corrplot(M, method = "circle", type = "full",
                   p.mat = p_mat, sig.level = 0.05, insig = "blank")

## Categorical association (bias-corrected Cramer's V) -----------------------
cramers_v <- function(x, y) {
  x <- as.factor(x); y <- as.factor(y)
  ok <- !(is.na(x) | is.na(y)); x <- x[ok]; y <- y[ok]
  tbl <- table(x, y)
  chi <- suppressWarnings(stats::chisq.test(tbl, correct = FALSE)$statistic)
  n <- sum(tbl); r <- nrow(tbl); k <- ncol(tbl)
  phi2     <- as.numeric(chi) / n
  phi2corr <- max(0, phi2 - (r - 1) * (k - 1) / (n - 1))
  rcorr <- r - (r - 1)^2 / (n - 1)
  kcorr <- k - (k - 1)^2 / (n - 1)
  sqrt(phi2corr / min(kcorr - 1, rcorr - 1))
}
cramers_v(mtcars$cyl, mtcars$am)   # association between cylinder count and transmission

5.2 Scaling (numeric column hp)

standard_scale_append <- function(df, col) {
  x <- df[[col]]
  df[[paste0(col, "_zscore")]] <- (x - mean(x, na.rm = TRUE)) / sd(x, na.rm = TRUE)
  df
}
minmax_scale_append <- function(df, col, range_min = 0, range_max = 1) {
  x  <- df[[col]]
  mn <- min(x, na.rm = TRUE); mx <- max(x, na.rm = TRUE)
  df[[paste0(col, "_minmax")]] <- (x - mn) / (mx - mn) * (range_max - range_min) + range_min
  df
}
robust_scale_append <- function(df, col) {
  x <- df[[col]]
  df[[paste0(col, "_robust")]] <- (x - median(x, na.rm = TRUE)) / IQR(x, na.rm = TRUE)
  df
}

mtcars_fe <- standard_scale_append(mtcars,    "hp")   # default: Standardisation (Z-score)
mtcars_fe <- minmax_scale_append(mtcars_fe,   "hp")   # default range [0, 1]
mtcars_fe <- robust_scale_append(mtcars_fe,   "hp")   # median / IQR
head(mtcars_fe[c("hp", "hp_zscore", "hp_minmax", "hp_robust")])

5.3 Encoding (categorical column cyl)

label_encode_append <- function(df, col) {
  df[[paste0(col, "_label")]] <- as.integer(factor(df[[col]]))
  df
}
onehot_encode_append <- function(df, col, drop_first = FALSE) {
  vals <- as.character(df[[col]])
  levs <- sort(unique(na.omit(vals)))
  if (isTRUE(drop_first) && length(levs) > 1) levs <- levs[-1]
  for (lv in levs) df[[paste0(col, "_oh_", make.names(lv))]] <- as.integer(vals == lv)
  df
}

mtcars_fe <- label_encode_append(mtcars_fe,  "cyl")   # default: Label Encoding
mtcars_fe <- onehot_encode_append(mtcars_fe, "cyl")   # One-Hot Encoding, drop_first = FALSE
head(mtcars_fe[grepl("^cyl", names(mtcars_fe))])

5.4 Classification / Binning (numeric column hp, reused from Scaling)

equal_width_bin_append <- function(df, col, n_bins = 4) {
  x    <- df[[col]]
  brks <- unique(round(seq(min(x, na.rm = TRUE), max(x, na.rm = TRUE), length.out = n_bins + 1), 2))
  df[[paste0(col, "_class")]] <- cut(x, breaks = brks, include.lowest = TRUE, dig.lab = 10)
  df
}
kmeans_bin_append <- function(df, col, n_bins = 4) {
  x <- df[[col]]
  set.seed(123)                                   # fixed seed for reproducible clusters
  km  <- kmeans(x, centers = n_bins)
  ord <- order(km$centers)                        # relabel classes low -> high
  df[[paste0(col, "_class")]] <- factor(match(km$cluster, ord),
                                        labels = paste0("Class_", seq_len(n_bins)))
  df
}

mtcars_fe <- equal_width_bin_append(mtcars_fe, "hp")   # default: Equal Width, 4 classes
mtcars_fe <- kmeans_bin_append(mtcars_fe,      "hp")   # K-Means, seed fixed at 123
table(mtcars_fe$hp_class)

5.5 H2O Import & Train / Validation / Test Split

library(h2o)

# Cluster is started once in global.R with these settings
h2o.init(
  nthreads      = -1,
  max_mem_size  = "3G",
  min_mem_size  = "512m",
  ice_root      = tempdir(),
  log_dir       = tempdir(),
  startH2O      = TRUE
)

# RAISINS writes the cleaned data.frame to a temporary CSV, then imports it
# with h2o.importFile(path, na.strings = ""); as.h2o() is the local equivalent.
mtcars_h2o <- as.h2o(mtcars)

y <- "am"                                             # dependent (target) variable
x <- setdiff(c("mpg", "hp", "wt", "qsec", "cyl"), y)  # independent (predictor) variables

train_pct               <- 0.80   # default: Training set percentage
valid_frac_of_remainder <- 0.50   # default: Validation as % of the held-out portion

splits <- h2o.splitFrame(
  mtcars_h2o,
  ratios = c(train_pct, (1 - train_pct) * valid_frac_of_remainder),
  seed   = 42
)
train <- h2o.assign(splits[[1]], "raisins_train")
valid <- h2o.assign(splits[[2]], "raisins_valid")
test  <- h2o.assign(splits[[3]], "raisins_test")
aml <- h2o.automl(
  x                = x,
  y                = y,
  training_frame   = train,
  validation_frame = valid,
  max_models       = 50,      # default (Custom settings range: 15-100)
  max_runtime_secs = 300,     # default: 5 minutes (Custom settings range: 1-25 min)
  seed             = 42,
  exclude_algos    = NULL,    # user may exclude DeepLearning / StackedEnsemble / XGBoost
  nfolds           = 0,       # forced to 0 whenever a validation_frame is supplied
  stopping_metric  = "AUTO",
  sort_metric      = "AUTO"   # AUTO -> AUC for this binary target
)

lb         <- as.data.frame(aml@leaderboard)   # leaderboard, ranked by sort_metric
best_model <- h2o.getModel(lb$model_id[1])

5.7 Model Performance Metrics

perf_train <- h2o.performance(best_model, newdata = train)
perf_valid <- h2o.performance(best_model, newdata = valid)
perf_test  <- h2o.performance(best_model, newdata = test)

get_metrics <- function(perf_obj) {
  c(
    RMSE                     = tryCatch(h2o.rmse(perf_obj),                   error = function(e) NA),
    MSE                      = tryCatch(h2o.mse(perf_obj),                    error = function(e) NA),
    MAE                      = tryCatch(h2o.mae(perf_obj),                    error = function(e) NA),
    RMSLE                    = tryCatch(h2o.rmsle(perf_obj),                  error = function(e) NA),
    `Mean Residual Deviance` = tryCatch(h2o.mean_residual_deviance(perf_obj), error = function(e) NA),
    `R-Square`               = tryCatch(h2o.r2(perf_obj),                     error = function(e) NA),
    AUC                      = tryCatch(h2o.auc(perf_obj),                    error = function(e) NA),
    AUCPR                    = tryCatch(h2o.aucpr(perf_obj),                  error = function(e) NA),
    LogLoss                  = tryCatch(h2o.logloss(perf_obj),                error = function(e) NA)
  )
}

rbind(Train = get_metrics(perf_train),
      Validation = get_metrics(perf_valid),
      Test = get_metrics(perf_test))

h2o.confusionMatrix(best_model, test)                              # classification only
as.data.frame(perf_test@metrics$max_criteria_and_metric_scores)     # binary-only threshold scores

Explore the entire AutoML module in preview mode using our demo dataset. website. To submit suggestions or report a workflow issue, please use the discussion section below, or visit the official RAISINS website. or visit the official RAISINS

6 RAISINS Native Statistical Framework

RAISINS uses R for all its statistical computations. Every package used to generate major results is listed and demonstrated with examples, so results can be reproduced independently. These results are then organized and formatted on the RAISINS website along with visualisation to make them easier to use and interpret. RAISINS also has its own custom-built statistical tools for managing workflows, validating results, and generating reports. Details of these are not fully covered here, they’re shared with outside researchers only on request, and are subject to licensing terms.

7 Package References

R Core Team. (2025). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. https://www.R-project.org/

Fryda, T., LeDell, E., Gill, N., Aiello, S., Fu, A., Candel, A., Click, C., Kraljevic, T., Nykodym, T., Aboyoun, P., Kurka, M., Malohlava, M., Poirier, S., & Wong, W. (2023). h2o: R Interface for the ‘H2O’ Scalable Machine Learning Platform (R package version 3.44.0.3). https://CRAN.R-project.org/package=h2o

Wei, T., & Simko, V. (2024). corrplot: Visualization of a Correlation Matrix (R package version 0.95). https://github.com/taiyun/corrplot

Feedback & Discussion