Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Abstract calculate_point_estimate up one more level #48

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

drewoldag
Copy link
Collaborator

Change Description

This PR moved the point estimation code to a core mixin class. This will avoid duplication if/when we move to introduce a Reducer RAIL stage.

Additionally, we call self.calculate_point_estimates in CatEstimator._do_chunk_output to avoid having to make changes in all subclasses of CatEstimator. i.e. we get point estimation for free (when a user requests it) without having to modify any subclasses.

  • My PR includes a link to the issue that I am addressing

Code Quality

  • I have read the Contribution Guide
  • My code follows the code style of this project
  • My code builds (or compiles) cleanly without any errors or warnings
  • My code contains relevant comments and necessary documentation

Project-Specific Pull Request Checklists

Bug Fix Checklist

  • My fix includes a new test that breaks as a result of the bug (if possible)
  • My change includes a breaking change
    • My change includes backwards compatibility and deprecation warnings (if possible)

New Feature Checklist

  • I have added or updated the docstrings associated with my feature using the NumPy docstring format
  • I have updated the tutorial to highlight my new feature (if appropriate)
  • I have added unit/End-to-End (E2E) test cases to cover my new feature
  • My change includes a breaking change
    • My change includes backwards compatibility and deprecation warnings (if possible)

Documentation Change Checklist

Build/CI Change Checklist

  • If required or optional dependencies have changed (including version numbers), I have updated the README to reflect this
  • If this is a new CI setup, I have added the associated badge to the README

Other Change Checklist

  • Any new or updated docstrings use the NumPy docstring format.
  • I have updated the tutorial to highlight my new feature (if appropriate)
  • I have added unit/End-to-End (E2E) test cases to cover any changes
  • My change includes a breaking change
    • My change includes backwards compatibility and deprecation warnings (if possible)

…culate_point_estimates` in `_do_chunk_output` to avoid having to make changes in all subclasses.
@drewoldag drewoldag self-assigned this Sep 12, 2023
@drewoldag drewoldag linked an issue Sep 12, 2023 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Sep 12, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.01% 🎉

Comparison is base (e6b0478) 95.56% compared to head (5a3bc45) 95.58%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #48      +/-   ##
==========================================
+ Coverage   95.56%   95.58%   +0.01%     
==========================================
  Files          31       32       +1     
  Lines        1625     1629       +4     
==========================================
+ Hits         1553     1557       +4     
  Misses         72       72              
Files Changed Coverage Δ
src/rail/core/__init__.py 100.00% <100.00%> (ø)
src/rail/core/point_estimation.py 100.00% <100.00%> (ø)
src/rail/estimation/estimator.py 100.00% <100.00%> (ø)

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

Copy link
Collaborator

@eacharles eacharles left a comment

Choose a reason for hiding this comment

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

let's hold off on this for a bit. While the code is nice, I'm not yet convinced that the CatReducer class is actually going to be something we want, and without that, there isn't that much point for this.

@drewoldag
Copy link
Collaborator Author

@eacharles I took another look over this after the prompt to do so at the Monday tag-up meeting, and I'm not seeing anything that needs to change at this point. Was there anything else in particular that you would like me to review prior to merging this code? If not, could I request a final re-review from you?

Copy link
Collaborator

@eacharles eacharles left a comment

Choose a reason for hiding this comment

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

I think this is fine to separate from the CatEstimator. What I'm not sure about is how else we would use this Mixin class. But we can worry about that when we get to it.

@drewoldag drewoldag merged commit cccd4c8 into main Oct 4, 2023
8 checks passed
@drewoldag drewoldag deleted the issue/42/abstract-point-estimation branch October 4, 2023 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move calculated_point_estimates logic into CatEstimator base class
2 participants