Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: minimizer configuration for fit.fit #330

Merged
merged 7 commits into from
Aug 13, 2022

Conversation

alexander-held
Copy link
Member

@alexander-held alexander-held commented Feb 21, 2022

Adding minimizer configuration options to cabinetry.fit: strategy, maxiter and tolerance allow configuring the Minuit strategy, maximum number of iterations and tolerance for Migrad. This extends the fit API functionality, similarly to #320 and #321.

When fitting with custom_fit=True, a ValueError is now raised if the fit fails.

Since the pyhf fit API does not support strategy=None currently (see scikit-hep/pyhf#1785), the strategy kwarg is only propagated for values other than None. This can be refactored in the future in case this changes.

The integration test changes are due to the default tolerance with custom_fit=True now matching the default when using the pyhf fit API (previously the tolerance was reduced by a factor of ten).

partially addresses #329

* added minimizer configuration options to fit.fit
* new supported keyword arguments are strategy, maxiter and tolerance
* raise ValueError when fits with custom_fit=True fail

@alexander-held alexander-held force-pushed the feat/minimizer-configuration branch from 5f6b990 to ee9965e Compare August 12, 2022 19:30
@codecov
Copy link

codecov bot commented Aug 13, 2022

Codecov Report

Merging #330 (840397a) into master (fa1b7a2) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master      #330   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           23        23           
  Lines         1925      1933    +8     
  Branches       310       312    +2     
=========================================
+ Hits          1925      1933    +8     
Impacted Files Coverage Δ
src/cabinetry/fit/__init__.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@alexander-held alexander-held changed the title feat: minimizer configuration feat: minimizer configuration for fit.fit Aug 13, 2022
@alexander-held alexander-held merged commit de175e6 into master Aug 13, 2022
@alexander-held alexander-held deleted the feat/minimizer-configuration branch August 13, 2022 19:00
@alexander-held alexander-held mentioned this pull request Aug 17, 2023
3 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant