pub struct Study {Show 15 fields
pub id: String,
pub name: String,
pub search_space: SearchSpace,
pub strategy: SearchStrategy,
pub pruning: PruningStrategy,
pub objectives: Vec<Objective>,
pub trials: Vec<Trial>,
pub frozen: HashMap<String, Value>,
pub seeds: Vec<i64>,
pub composite: Option<CompositeObjective>,
pub created_at: Option<DateTime<Utc>>,
pub updated_at: Option<DateTime<Utc>>,
pub tags: Vec<String>,
pub git_sha: Option<String>,
pub planned_trials: Option<usize>,
}Expand description
An optimization study: orchestrates multiple trials.
Fields§
§id: StringUnique identifier, generated by Study::new.
name: StringHuman-readable name; needs no uniqueness.
search_space: SearchSpaceThe dimensions trials are sampled from.
strategy: SearchStrategyHow configurations are chosen (grid, random, TPE, …).
pruning: PruningStrategyEarly-stopping policy for unpromising trials; None by default.
objectives: Vec<Objective>Declared objectives. Only the first is scored today (see
Study::objective_value), unless composite overrides it.
trials: Vec<Trial>Every trial the study has run, in start order — terminal and in-flight alike.
frozen: HashMap<String, Value>Study-level fixed parameters, injected into every trial’s
params by the runner (same mechanism as
SearchSpace::freeze,
but settable after the space was built).
seeds: Vec<i64>Experiment seeds: when non-empty, every sampled configuration is
evaluated once per seed (trial params carry "seed"), giving
each seed an independent cache line and resumable trial.
composite: Option<CompositeObjective>Scalar objective composed from several metrics; takes precedence
over objectives when set.
created_at: Option<DateTime<Utc>>When the study was created. serde(default): absent in
pre-timestamp JSON.
updated_at: Option<DateTime<Utc>>When the study was last saved/modified.
Free-form labels for filtering studies in listings.
git_sha: Option<String>Git commit the study ran at, for reproducibility bookkeeping.
planned_trials: Option<usize>Total trials resolved by the sampler at run start (grid sizes are unknown until the search space is prepared).
Implementations§
Source§impl Study
impl Study
Sourcepub fn new(
name: impl Into<String>,
search_space: SearchSpace,
strategy: SearchStrategy,
objectives: Vec<Objective>,
) -> Self
pub fn new( name: impl Into<String>, search_space: SearchSpace, strategy: SearchStrategy, objectives: Vec<Objective>, ) -> Self
A fresh study with a generated id and created_at stamped
now: no trials, no pruning (PruningStrategy::None), no
composite objective. Layer options on with the with_*
builders.
Sourcepub fn with_pruning(self, pruning: PruningStrategy) -> Self
pub fn with_pruning(self, pruning: PruningStrategy) -> Self
Builder: replace the pruning strategy (the default from
Study::new is PruningStrategy::None).
Sourcepub fn with_composite(self, composite: CompositeObjective) -> Self
pub fn with_composite(self, composite: CompositeObjective) -> Self
Builder: set the composite objective. Once set it becomes the
value the optimizer sees, overriding objectives for scoring
and direction — see Study::objective_value.
Sourcepub fn completed_trials(&self) -> Vec<&Trial>
pub fn completed_trials(&self) -> Vec<&Trial>
Trials in TrialState::Completed — the population pruners
compare against. Pruned and failed trials are excluded.
Sourcepub fn primary_direction(&self) -> Option<Direction>
pub fn primary_direction(&self) -> Option<Direction>
Direction of the effective objective (composite if set, else the first declared objective).
Sourcepub fn objective_value(&self, trial: &Trial) -> Option<f64>
pub fn objective_value(&self, trial: &Trial) -> Option<f64>
The single source of truth for scoring a trial: the composite
objective if set, else the best value of the first objective’s
metric. None for incomplete trials or missing metrics.
Sourcepub fn best_trial(&self) -> Option<&Trial>
pub fn best_trial(&self) -> Option<&Trial>
Get the best trial for the effective objective.
Sourcepub fn best_value(&self) -> Option<f64>
pub fn best_value(&self) -> Option<f64>
Objective value of the best trial.
Sourcepub fn total_trials(&self) -> Option<usize>
pub fn total_trials(&self) -> Option<usize>
Number of total planned trials (if known). Prefers the count the sampler resolved at run start (covers grid strategies).