Skip to contents

GSDTuneJob

GSDTuneJob

Value

An R6 class generator. Use $new() to create a GSDTuneJob object.

Details

R6 class representing a dependency-aware tuning job for group sequential designs created by gsDesign::gsDesign() or gsDesign::gsSurv().

Public fields

target

Target design function name ("gsDesign" or "gsSurv").

base_args

Named list of fixed arguments passed to the target function.

tune_specs

Named list of tuning specifications for explored arguments.

param_space

Internal parameter space used for configuration generation.

spec

Audit record including base/tuned args and sessionInfo().

Methods


Method new()

Create a new tune job.

Usage

GSDTuneJob$new(target = c("gsDesign", "gsSurv", "gsSurvCalendar"), args)

Arguments

target

Target function name ("gsDesign", "gsSurv", or "gsSurvCalendar").

args

Named list of evaluated arguments.


Method run()

Evaluate configurations under a search strategy.

Usage

GSDTuneJob$run(
  strategy = c("grid", "random"),
  n = NULL,
  parallel = TRUE,
  seed = NULL,
  cache_dir = NULL,
  metrics_fun = NULL
)

Arguments

strategy

Search strategy ("grid" or "random").

n

Number of configurations for random search.

parallel

Whether to evaluate configurations in parallel.

seed

Optional seed for reproducibility.

cache_dir

Optional directory to cache design objects as RDS.

metrics_fun

Optional metric hook.


Method results()

Return the results data.frame.

Usage

GSDTuneJob$results()


Method summarize()

Summarize the run (counts + numeric metric summaries).

Usage

GSDTuneJob$summarize()


Method design()

Retrieve a design object for configuration i.

Usage

GSDTuneJob$design(i)

Arguments

i

Row index of the configuration.


Method call_args()

Return the underlying argument list for configuration i.

Usage

GSDTuneJob$call_args(i)

Arguments

i

Row index of the configuration.


Method best()

Rank configurations by a metric (with optional constraints).

Usage

GSDTuneJob$best(metric, direction = c("min", "max"), constraints = NULL)

Arguments

metric

Metric column name.

direction

Ranking direction ("min" or "max").

constraints

Optional constraints (function or expression).


Method pareto()

Compute a Pareto (non-dominated) set for multiple metrics.

Usage

GSDTuneJob$pareto(metrics, directions)

Arguments

metrics

Metric column names.

directions

Directions for each metric ("min"/"max").


Method plot()

Create a quick exploration plot.

Usage

GSDTuneJob$plot(metric, x, color = NULL, facet = NULL)

Arguments

metric

Y-axis metric column name.

x

X-axis column name.

color

Optional color column name.

facet

Optional faceting column name.


Method report()

Render an HTML report.

Usage

GSDTuneJob$report(path)

Arguments

path

Output HTML file path.


Method clone()

The objects of this class are cloneable with this method.

Usage

GSDTuneJob$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

job <- GSDTuneJob$new(target = "gsDesign", args = list(k = 3, alpha = 0.025))
job$spec$target
#> [1] "gsDesign"