Open
Conversation
- don't convert mother+newborn info dictionaries to dataframe (we only need one entry) - don't create unnecessary series/dataframes - get only the required properties for the model's predict function - update predict function to operate on single individual
apply_risk_of_neonatal_complications_in_week_oneapply_risk_of_neonatal_complications_in_week_one
…ataframes for linear models
apply_risk_of_neonatal_complications_in_week_one… reducing data access - Access mother_and_newborn_info dict directly per person instead of DataFrame - Build Series from lists rather than creating intermediate DataFrames - Remove redundant Series wrapper for DataFrame column access
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@joehcollins - the previous code for
predict_early_onset_neonatal_sepsis_week_1allowed operating on multiple individuals but it looks like it is only called byapply_risk_of_neonatal_complications_in_week_onefor single individuals. I've updated the both caller and callee in light of that.Improve performance by reducing unnecessary data access:
Also optimised
PostnatalWeekOneMaternalEvent.apply()by removing unnecessary data access.