Skip to main content

Module model_based

Module model_based 

Source
Expand description

Model-Based Black-Box Optimization.

Provides surrogate-model-driven optimization using ensembles of decision trees (Random Forest) as the surrogate model. Unlike GP-based methods, tree ensembles scale more gracefully to moderate-dimensional problems and do not require careful kernel design.

§Contents

  • RandomForestSurrogate – ensemble of regression trees, exposes fit and predict (mean + uncertainty from tree variance).
  • ei_random_forest – Expected Improvement acquisition function for the RF surrogate.
  • SmacOptimizer – Sequential Model-based Algorithm Configuration (SMAC) loop, which alternates between local and random search phases.

§Quick Start

use scirs2_optimize::blackbox::model_based::{
    SmacOptimizer, SmacConfig,
};

let bounds = vec![(-5.0_f64, 5.0_f64), (-5.0, 5.0)];
let config = SmacConfig { n_initial: 6, n_iterations: 20, seed: Some(42),
    ..Default::default() };
let mut smac = SmacOptimizer::new(bounds, config).expect("build smac");
let result = smac.optimize(|x: &[f64]| x[0].powi(2) + x[1].powi(2), 20)
    .expect("optimize");
println!("Best: {:?} f={:.4}", result.x_best, result.f_best);

Structs§

RandomForestSurrogate
Random Forest surrogate for black-box optimization.
SmacConfig
Configuration for the SMAC optimizer.
SmacOptimizer
SMAC: Sequential Model-based Algorithm Configuration.
SmacResult
Result of SMAC optimization.

Functions§

ei_random_forest
Expected Improvement acquisition for a Random Forest surrogate.