Table of Contents

Class GridSearchOptimizerOptions

Namespace
SignalSharp.Optimization.GridSearch
Assembly
SignalSharp.dll

Configuration options for the GridSearchOptimizer<TInput, TMetric>.

public record GridSearchOptimizerOptions : IEquatable<GridSearchOptimizerOptions>
Inheritance
GridSearchOptimizerOptions
Implements
Inherited Members

Constructors

GridSearchOptimizerOptions()

public GridSearchOptimizerOptions()

Properties

DefaultGridSteps

Default number of grid steps to use for each parameter if not specified otherwise. Must be at least 2.

public int DefaultGridSteps { get; init; }

Property Value

int

EarlyStoppingThreshold

Early stopping threshold. If the objective metric reaches this value or lower, the optimization stops early. If null, no early stopping is used.

public double? EarlyStoppingThreshold { get; init; }

Property Value

double?

EnableAdaptiveRefinement

Whether to enable adaptive grid refinement around the best solution. When true, after the initial grid search, a finer grid is created around the best solution to improve precision.

public bool EnableAdaptiveRefinement { get; init; }

Property Value

bool

EnableParallelProcessing

Whether to enable parallel processing of parameter combinations.

public bool EnableParallelProcessing { get; init; }

Property Value

bool

MaxDegreeOfParallelism

Maximum degree of parallelism when EnableParallelProcessing is true. If null, defaults to ProcessorCount.

public int? MaxDegreeOfParallelism { get; init; }

Property Value

int?

MaxFunctionEvaluations

Maximum number of function evaluations to perform. If null, the grid is evaluated exhaustively up to a maximum of 1,000,000 combinations.

public int? MaxFunctionEvaluations { get; init; }

Property Value

int?

Remarks

This is particularly useful for higher-dimensional parameter spaces where the total number of grid points would be prohibitively large.

When the grid exceeds the effective limit (the configured budget, or 1,000,000 combinations when null), the combos are systematically stride-sampled instead of evaluated exhaustively, and a grid larger than the limit with a null budget is rejected with InvalidOperationException rather than exhausting memory.

PerParameterGridSteps

Allows overriding the number of grid steps for specific parameters. Keys are parameter names (matching Name). Values must be at least 2.

public IReadOnlyDictionary<string, int>? PerParameterGridSteps { get; init; }

Property Value

IReadOnlyDictionary<string, int>

RefinementGridSteps

Number of grid steps to use for each parameter in the refinement phase.

public int RefinementGridSteps { get; init; }

Property Value

int

RefinementRangeFactor

The factor that determines the range of the refined grid relative to the original range. For example, 0.2 means the refined grid spans 20% of the original range around the best point.

public double RefinementRangeFactor { get; init; }

Property Value

double

UseLogarithmicScaleFor

Whether to use logarithmic spacing instead of linear spacing for certain parameters. Particularly useful for parameters like alpha, beta, gamma in exponential smoothing which often work better with logarithmic spacing in the 0-1 range.

public IReadOnlySet<string>? UseLogarithmicScaleFor { get; init; }

Property Value

IReadOnlySet<string>