Augment axis-aligned box learner with beta densities
augment.LearnerSubspaceBox.RdTransforms data from the fitted axis-aligned hyperrectangle subspace to the unit hypercube and fits univariate beta distributions to each hyperparameter dimension using weighted maximum likelihood estimation. Since box learners use diagonal transformation matrices (independent scaling), inversion is computationally efficient.
Arguments
- x
A
LearnerSubspaceBoxobject with fitted subspace parameters- regularize
Logical indicating whether to enforce
alpha >= 1andbeta >= 1to avoid U-shaped densities. Default:TRUE- ...
Additional arguments passed to
fit_beta_mle_single(e.g.,tol,max_iter,clip_eps)
Value
A data.table with columns:
parameter: Hyperparameter namealpha: Fitted beta shape parameter (alpha > 0)beta: Fitted beta shape parameter (beta > 0)converged: Logical indicating whether MLE convergediterations: Number of Newton-Raphson iterations usedcat_hp: Categorical level (only if task has categorical hyperparameters)
Details
Algorithm:
For each categorical level (or globally if no categorical hyperparameters):
Extract fitted box bounds (min, max) for each hyperparameter
Transform data to unit cube: \(x = (y - min) / (max - min)\)
Filter points where all coordinates lie in \([0,1]^d\)
Fit \(Beta(\alpha, \beta)\) to each dimension via weighted MLE
Apply regularization if requested: \(\alpha, \beta \geq 1\)
If no valid points remain after filtering (shouldn't happen for box learners with lambda = NULL), returns uniform prior \(Beta(1,1)\) for all dimensions.
Weights:
Data points are weighted by their performance (target measure values), normalized to sum to 1. This gives more influence to higher-performing configurations when fitting the beta distributions.
Regularization:
When regularize = TRUE (default), ensures \(\alpha \geq 1\) and
\(\beta \geq 1\). This prevents U-shaped densities (which occur when both
parameters are less than 1) and ensures the mode exists in the interior of \([0,1]\).
Categorical Hyperparameters:
When the task includes categorical hyperparameters, separate beta distributions are fitted for each combination of hyperparameter and categorical level.
See also
LearnerSubspaceBox for the learner class.
fit_beta_mle_single for the univariate beta MLE algorithm.
augment.LearnerSubspacePolygon for the oriented hyperrectangle variant.
Examples
if (FALSE) { # \dontrun{
# Train learner
task <- TaskSubspace$new(data, target_measure = "auc",
hps = c("learning_rate", "max_depth"))
learner <- LearnerSubspaceBox$new(task)
learner$train(q_val = 0.9)
# Fit beta densities
densities <- augment(learner)
print(densities)
# Without regularization (allows U-shaped densities)
densities_unreg <- augment(learner, regularize = FALSE)
# Sample from fitted distributions
n_samples <- 100
sampled_lr <- rbeta(n_samples,
densities[parameter == "learning_rate"]$alpha,
densities[parameter == "learning_rate"]$beta)
} # }