You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, LeftTruncatedModel and AgeReplacementModel from relife.core.nested_model are used internally in the Policy objects, depending on the arguments passed by the user.
While these classes are not part of the user API, it could be beneficial to make them more accessible in a user-friendly way.
At present, composing the constructor like AgeReplacementModel(Weibull(...)) is the only way to create an AgeReplacementModel object. However, this composition approach can be unintuitive for users. For instance, while AFT(Weibull(...)) aligns well with the concept of function composition in mathematics, constructing AgeReplacementModel(Weibull(...)) feels more like a model transformation rather than composition, which can be confusing.
To address this, I propose the following improvement for better usability:
model=Weibull(..., left_truncated=True) # In the backend, this would construct LeftTruncatedModel(Weibull(...))
Or
model=Weibull(..., age_replacement=True) # In the backend, this would construct AgeReplacementModel(Weibull(...))
This behavior could be implemented by overriding the __new__ method in LifetimeModel, allowing for seamless configuration of nested models while keeping the syntax simple and intuitive for users.
The text was updated successfully, but these errors were encountered:
In comparison, without this approach, the user would need to have explicit knowledge of the LeftTruncatedModel class and work with it directly, which is less intuitive and less concise:
Currently,
LeftTruncatedModel
andAgeReplacementModel
fromrelife.core.nested_model
are used internally in thePolicy
objects, depending on the arguments passed by the user.While these classes are not part of the user API, it could be beneficial to make them more accessible in a user-friendly way.
At present, composing the constructor like
AgeReplacementModel(Weibull(...))
is the only way to create anAgeReplacementModel
object. However, this composition approach can be unintuitive for users. For instance, whileAFT(Weibull(...))
aligns well with the concept of function composition in mathematics, constructingAgeReplacementModel(Weibull(...))
feels more like a model transformation rather than composition, which can be confusing.To address this, I propose the following improvement for better usability:
Or
This behavior could be implemented by overriding the
__new__
method inLifetimeModel
, allowing for seamless configuration of nested models while keeping the syntax simple and intuitive for users.The text was updated successfully, but these errors were encountered: