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

22 cumulative imputation links are incorrect for fic #29

Merged
merged 21 commits into from
Jun 28, 2024

Conversation

AntonZogk
Copy link
Collaborator

@AntonZogk AntonZogk commented Jun 11, 2024

Summary

This pull request aims to fix some bugs as outlined in the #22 , tests and test data adapted accordingly

Checklists

This pull request meets the following requirements:

  • installable with all dependencies recorded
  • runs without error
  • follows PEP8 and project specific conventions
  • appropriate use of comments, for example no descriptive comments
  • functions documented using Numpy style docstings
  • assumptions and decisions log considered and updated if appropriate
  • unit tests have been updated to cover essential functionality for a reasonable range of inputs and conditions
  • other forms of testing such as end-to-end and user-interface testing have been considered and updated as required
  • tests suite passes (locally as a minimum)
  • peer reviewed with review recorded

If you feel some of these conditions do not apply for this pull request, please
add a comment to explain why.

  • installable with all dependencies recorded not applicable, the changes are for the low levels functions

The imputation_group column should look at imputation_marker for changes instead of missing_value
To fix a bug with cummulative links we are using imputation marker
Add a new column with imputation marker to test data
Adapt tests accordingly
The markers in the dictionary must be the same
as the ones created from imputation_flags
If we use constructed column this won't allow the
forward fill which will then be used to multiple
columns, we are using imputed_value which has
na if relevant row is not constructed
@AntonZogk AntonZogk linked an issue Jun 11, 2024 that may be closed by this pull request
@rowanhemsi rowanhemsi self-requested a review June 12, 2024 10:45
Copy link
Collaborator

@rowanhemsi rowanhemsi left a comment

Choose a reason for hiding this comment

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

Not very familiar with the bug so would want to check with someone else whether the test data covers it. Have left a couple of questions and suggestions on the code but most of them are very small

"fill_column": target,
"fill_method": "bfill",
"link_column": cumulative_backward_link,
},
"fic": {
# FIC only works if the C is in the first period of the business being
Copy link
Collaborator

Choose a reason for hiding this comment

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

Has this issue been resolved?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@robertswh i think it is resolved?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

By accident i removed these comments from the code, i will re add them in the original code.

This pull request is not related what is being mentioned in the comments, the comments are related to the manual construction methods and things we must be aware of.

src/cumulative_imputation_links.py Outdated Show resolved Hide resolved
tests/test_cumulative_imputation_links.py Outdated Show resolved Hide resolved
tests/test_cumulative_imputation_links.py Outdated Show resolved Hide resolved
@AntonZogk AntonZogk marked this pull request as draft June 13, 2024 12:16
@AntonZogk AntonZogk marked this pull request as ready for review June 13, 2024 12:30
@AntonZogk
Copy link
Collaborator Author

AntonZogk commented Jun 13, 2024

Not very familiar with the bug so would want to check with someone else whether the test data covers it. Have left a couple of questions and suggestions on the code but most of them are very small

We changed the approach and this is reflected to the test data ( added a new column for marker). As described at #22 , instead of looking at time difference , the code now looks at imputation marker difference. So yes it is covered.

The other bugs are related how functions work together, and getting them ready for the imputation wrapper

@AntonZogk AntonZogk force-pushed the 22-cumulative-imputation-links-are-incorrect-for-fic branch from a9d1391 to db93653 Compare June 28, 2024 12:49
The imputation_group column should look at imputation_marker for changes instead of missing_value
To fix a bug with cummulative links we are using imputation marker
Add a new column with imputation marker to test data
Adapt tests accordingly
The markers in the dictionary must be the same
as the ones created from imputation_flags
If we use constructed column this won't allow the
forward fill which will then be used to multiple
columns, we are using imputed_value which has
na if relevant row is not constructed
@AntonZogk AntonZogk marked this pull request as draft June 28, 2024 13:21
@AntonZogk AntonZogk marked this pull request as ready for review June 28, 2024 13:22
@AntonZogk
Copy link
Collaborator Author

Rebased the branch to main to resolve conflicts caused by changing folder name src -> mbs_results

@AntonZogk AntonZogk merged commit d6e7343 into main Jun 28, 2024
3 checks passed
@AntonZogk AntonZogk deleted the 22-cumulative-imputation-links-are-incorrect-for-fic branch June 28, 2024 13:25
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.

Cumulative imputation links are incorrect for FIC
3 participants