EvolutionaryAutoML<T, TInput, TOutput>

Models & Types · AiDotNet.AutoML

Built-in AutoML strategy that uses an evolutionary (genetic) approach to propose new trials.

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

For Beginners

This is like natural selection: keep the best settings, mix them, and make small random changes to discover even better settings over time.

How It Works

This strategy treats each trial configuration as an “individual” and iteratively improves by:

  • selecting strong prior trials as parents
  • combining their settings (crossover)
  • randomly tweaking some settings (mutation)

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 EvolutionaryAutoML<double, Matrix<double>, Vector<double>>();
var bestModel = await automl.SearchAsync(
    trainInputs, trainTargets,
    valInputs, valTargets,
    
    timeLimit: TimeSpan.FromMinutes(15));

Constructors

Constructor Summary
EvolutionaryAutoML(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)