Skip to content

Adding regularization objective option to parmest#3550

Open
sscini wants to merge 65 commits into
Pyomo:mainfrom
sscini:parmest_obj_regularization
Open

Adding regularization objective option to parmest#3550
sscini wants to merge 65 commits into
Pyomo:mainfrom
sscini:parmest_obj_regularization

Conversation

@sscini
Copy link
Copy Markdown
Contributor

@sscini sscini commented Apr 2, 2025

Fixes # .

Summary/Motivation:

Currently, the only default objective is the standard SSE objective. This edit provides the capability to add a
regularization term to the SSE objective with a prior FIM and reference parameter values.

Changes proposed in this PR:

  • Added prior_FIM and theta_ref as keyword arguments for Estimator
  • Added options within Estimator to apply the regularization term to SSE if the new arguments were defined

TODO before converting from draft

  • Receive feedback from collaborators on logical setup
  • Finish edits and debug
  • Confirm functionality with examples

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@sscini
Copy link
Copy Markdown
Contributor Author

sscini commented Apr 2, 2025

@djlaky @adowling2 Please provide early feedback

@sscini sscini changed the title Adding regularization feature as an option to the default SSE objective Adding regularization feature in parmest as an option to the default SSE objective Apr 2, 2025
Copy link
Copy Markdown
Member

@adowling2 adowling2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sscini See my early feedback.

Comment thread pyomo/contrib/parmest/parmest.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py Outdated
@sscini
Copy link
Copy Markdown
Contributor Author

sscini commented Jul 15, 2025

UPDATE (07/15/25); Intended to be added AFTER Shammah's weighted SSE PR (#3535) and follow a similar format, adding another option for available objectives using Enums.

Currently preparing for next stage of review

@sscini
Copy link
Copy Markdown
Contributor Author

sscini commented Jul 15, 2025

@adowling2 @djlaky Made some edits to this finally. Meant to follow Shammah's layout in PR #3535, waiting to merge, currently some conflicts I cannot resolve on my end.

Made it's own full objective instead of a term to add. Also added weighting term.

Ready for next round of review.

@sscini sscini changed the title Adding regularization feature in parmest as an option to the default SSE objective [Depends on #3535] Adding regularization objective option to parmest Aug 18, 2025
@blnicho blnicho changed the title [Depends on #3535] Adding regularization objective option to parmest Adding regularization objective option to parmest Sep 30, 2025
@sscini
Copy link
Copy Markdown
Contributor Author

sscini commented Dec 12, 2025

Will not be actively worked on before finalization of _Q_opt_blocks. Closing for now to resume in the future.

@sscini sscini closed this Dec 12, 2025
@mrmundt mrmundt self-requested a review April 14, 2026 18:44
@sscini
Copy link
Copy Markdown
Contributor Author

sscini commented May 15, 2026

@blnicho Thank you for fixing the formatting issue. I tried to resolve the merge conflict after _Q_opt and was not near my laptop. Both of the failing tests are not related to my tests.

Comment thread pyomo/contrib/parmest/examples/rooney_biegler/regularization_example.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py
Comment thread pyomo/contrib/parmest/parmest.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py
Copy link
Copy Markdown
Member

@blnicho blnicho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sscini I have a few minor comments and questions but otherwise this looks fine.

Comment thread pyomo/contrib/parmest/tests/test_examples.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py
Comment thread pyomo/contrib/parmest/parmest.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py
Comment thread pyomo/contrib/parmest/parmest.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py Outdated
@sscini
Copy link
Copy Markdown
Contributor Author

sscini commented May 16, 2026

@blnicho @mrmundt Thank you both for all your comments. Running new checks now, but I believe all are addressed.

@sscini sscini requested review from blnicho and mrmundt May 16, 2026 00:35
@codecov
Copy link
Copy Markdown

codecov Bot commented May 16, 2026

Codecov Report

❌ Patch coverage is 81.32530% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.11%. Comparing base (787c6ff) to head (ac505bb).
⚠️ Report is 73 commits behind head on main.

Files with missing lines Patch % Lines
pyomo/contrib/parmest/parmest.py 80.88% 26 Missing ⚠️
.../examples/rooney_biegler/regularization_example.py 83.33% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3550      +/-   ##
==========================================
- Coverage   90.12%   90.11%   -0.01%     
==========================================
  Files         905      906       +1     
  Lines      107490   107638     +148     
==========================================
+ Hits        96873    97000     +127     
- Misses      10617    10638      +21     
Flag Coverage Δ
builders 29.10% <5.42%> (-0.02%) ⬇️
default 86.46% <81.32%> (?)
expensive 35.18% <21.68%> (?)
linux 87.61% <81.32%> (-2.02%) ⬇️
linux_other 87.61% <81.32%> (-0.01%) ⬇️
oldsolvers 28.05% <5.42%> (-0.04%) ⬇️
osx 82.99% <81.32%> (+<0.01%) ⬆️
win 85.53% <81.32%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@slilonfe5
Copy link
Copy Markdown
Member

@sscini @blnicho I’ve noticed that the code coverage of ParmEst is now at 81%, down from 90%. Is this something to fix in this PR while we’re at it? So someone in the future doesn’t have to worry about this.

@sscini
Copy link
Copy Markdown
Contributor Author

sscini commented May 16, 2026

@sscini @blnicho I’ve noticed that the code coverage of ParmEst is now at 81%, down from 90%. Is this something to fix in this PR while we’re at it? So someone in the future doesn’t have to worry about this.

Great point @slilonfe5. I am planning to add a few today. Also, is ParmEst at 81% or my change lines in this code? I think what it says here is my changes are at 81% but I could be wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Ready for design review

Development

Successfully merging this pull request may close these issues.

6 participants