-
Notifications
You must be signed in to change notification settings - Fork 1
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
Time trend BoxCox transform and weight trending #500
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
It looks good to me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made a few small comments... I'd be interested to have a walkthrough though if you've got time!
auto expected_trend = std::make_unique<std::unordered_map<core::Identifier, double>>(); | ||
auto expected_trend_boxcox = std::make_unique<std::unordered_map<core::Identifier, double>>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know we talked about this on the last PR... but I'm still a bit confused as to why these need to be std::unique_ptr
s. Even if they're being converted into std::shared_ptr
s at some point can't you just std::move
your std::vector
(for example) into a std::shared_ptr<std::vector<T>>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inside model parser, probably. I'll have a look.
weight -= 0.6256 * get_expected(context, sex, age, "Height"_id, std::nullopt, false); | ||
weight += 0.4925 * age; | ||
weight -= 16.6166 * Person::gender_to_value(sex); | ||
return weight; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do these coefficients come from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -47,7 +47,9 @@ double Person::get_risk_factor_value(const core::Identifier &key) const { | |||
throw std::out_of_range("Risk factor not found: " + key.to_string()); | |||
} | |||
|
|||
float Person::gender_to_value() const { | |||
float Person::gender_to_value() const { return gender_to_value(gender); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering whether these helpers should be member functions of the core::Gender
enum class
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good shout.
Sure! Today is good. |
Sorry, only just saw this... Could do tomorrow? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #500 +/- ##
==========================================
- Coverage 46.42% 46.17% -0.26%
==========================================
Files 161 161
Lines 7756 7798 +42
Branches 1045 1054 +9
==========================================
Hits 3601 3601
- Misses 3969 4011 +42
Partials 186 186 ☔ View full report in Codecov by Sentry. |
Resolves #499
Resolves #501
Resolves #477
The main changes here are:
get_expected
inKevinHallModel
, to compute expected weight from nutrientsRiskFactorAdjustableModel
methods to pre-empt bugsperson.cpp
Happy to walk through over a chat.