# DefaultToyStrategy¶

class zfit.minimize.DefaultToyStrategy(nan_penalty=100, nan_tolerance=30, **kwargs)[source]

Same as DefaultStrategy, but does not raise an error on full failure, instead return an invalid FitResult.

This can be useful for toy studies, where multiple fits are done and a failure should simply be counted as a failure instead of rising an error.

Pushback by adding nan_penalty * counter to the loss if NaNs are encountered.

The counter indicates how many NaNs occurred in a row. The nan_tolerance is the upper limit, if this is exceeded, the fallback will be used and an error is raised.

Parameters