GridSearch

class sherpa.optmethods.GridSearch(name='gridsearch')[source]

Bases: sherpa.optmethods.OptMethod

Grid Search optimization method.

This method evaluates the fit statistic for each point in the parameter space grid; the best match is the grid point with the lowest value of the fit statistic. It is intended for use with template models as it is very inefficient for general models.

num

int – The size of the grid for each parameter when sequence is None, so npar^num fits will be evaluated, where npar is the number of free parameters. The grid spacing is uniform.

sequence

sequence of numbers or None – The list through which to evaluate. Leave as None to use a uniform grid spacing as determined by the num attribute.

numcores

int or None – The number of CPU cores to use. The default is 1 and a value of None will use all the cores on the machine.

maxfev

int or None – The maxfev attribute if method is not None.

ftol

number – The ftol attribute if method is not None.

method

str or None – The optimization method to use to refine the best-fit location found using the grid search. If None then this step is not run.

verbose

int – The amount of information to print during the fit. The default is 0, which means no output.

Attributes Summary

default_config

Methods Summary

fit(statfunc, pars, parmins, parmaxes[, ...])

Attributes Documentation

default_config

Methods Documentation

fit(statfunc, pars, parmins, parmaxes, statargs=(), statkwargs={})