BayesianOptimizationAutoML<T, TInput, TOutput>

Models & Types · AiDotNet.AutoML

Built-in AutoML strategy that uses a lightweight Bayesian-style surrogate to guide trial selection.

Inheritance: AutoMLModelBase<T, TInput, TOutput> → SupervisedAutoMLModelBase<T, TInput, TOutput> → BuiltInSupervisedAutoMLModelBase<T, TInput, TOutput> → BayesianOptimizationAutoML<T, TInput, TOutput>

For Beginners

Instead of trying totally random settings every time, this strategy learns from earlier trials and tries more settings similar to the best ones found so far.

How It Works

This implementation uses a pragmatic, production-friendly approach:

  • Use a bandit policy to allocate trials across candidate model families.
  • Use a kernel-weighted surrogate over observed trials to bias sampling toward promising regions.

Example

var valTargets = new Vector<double>(new double[] { 0.0, 1.0, 0.0, 1.0 });
var valInputs = new Matrix<double>(new double[,] { { 1.0, 2.0 }, { 3.0, 4.0 }, { 5.0, 6.0 }, { 7.0, 8.0 } });
var trainTargets = new Vector<double>(new double[] { 0.0, 1.0, 0.0, 1.0 });
var trainInputs = new Matrix<double>(new double[,] { { 1.0, 2.0 }, { 3.0, 4.0 }, { 5.0, 6.0 }, { 7.0, 8.0 } });
var automl = new BayesianOptimizationAutoML<double, Matrix<double>, Vector<double>>();
var bestModel = await automl.SearchAsync(
    trainInputs, trainTargets,
    valInputs, valTargets,
    
    timeLimit: TimeSpan.FromMinutes(10));

Constructors

Constructor Summary
BayesianOptimizationAutoML(Random random)

Methods

Method Summary
Task<Dictionary<string, object>> SuggestNextTrialAsync()
Task<IFullModel<T, TInput, TOutput>> SearchAsync(TInput inputs, TOutput targets, TInput validationInputs, TOutput validationTargets, TimeSpan timeLimit, CancellationToken cancellationToken)