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
PHReg.predict returns a Bunch with predicted and standard errors which breaks writing generic code on top of it #2884 (comment)
it would also break generic cross validation or similar.
The pattern that we get slowly into is that predict stays just the mean prediction/expected values and a new method get_prediction returns the full prediction results.
One possibility would be to add a new keyword return_se=False which could be reused and wrapped by get_prediction
Leland and I are looking at this and will come up with a PR.
Kerby
On Fri, Apr 15, 2016 at 12:26 PM, Josef Perktold [email protected]
wrote:
PHReg.predict returns a Bunch with predicted and standard errors which
breaks writing generic code on top of it #2884 (comment) #2884 (comment)
it would also break generic cross validation or similar.
The pattern that we get slowly into is that predict stays just the mean
prediction/expected values and a new method get_prediction returns the
full prediction results.
One possibility would be to add a new keyword return_se=False which could
be reused and wrapped by get_prediction
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub #2894
@kshedden@lbybee If you have comments about the current implementation for get_prediction, then I would appreciate those. I have only advertised it reluctantly because I wasn't sure about some of the API and implementation choices.
I've gotten something for this together that seems to be working, the only issue right now is that it breaks the MICE tests. @kshedden and I are actually meeting tomorrow and I was planning to submit a PR after we talk.
Basically the way it is working right now is in line with what you mentioned in the initial comment. I've duplicated a version of _prediction from regression that works for PHReg and have modified the tests to account for both possible versions of the predict. Given that there is some overlap with the code now for get_prediction it might be worth it to put together a more abstract version.
@lbybee thanks for the update.
IIRC:
Mice is special casing the predict method of PHReg which won't be needed anymore once predict follows the standard pattern.
The special casing in base.Results.predict uses an attribute instead of isinstance check which is not directly affected by changes in PHReg predict, but the special casing can be removed when PHReg.predict is standardized.
About your new get_prediction: Is there just code duplication/overlap, or do you want to change parts of the API to fit your case?
It isn't a complete duplicate or subset of the other get_prediction, there were some changes that needed to be made to make it play nice with PHReg, but they were fairly small changes.
Activity
kshedden commentedon Apr 15, 2016
Leland and I are looking at this and will come up with a PR.
Kerby
On Fri, Apr 15, 2016 at 12:26 PM, Josef Perktold [email protected]
wrote:
josef-pkt commentedon May 3, 2016
@kshedden @lbybee If you have comments about the current implementation for get_prediction, then I would appreciate those. I have only advertised it reluctantly because I wasn't sure about some of the API and implementation choices.
lbybee commentedon May 3, 2016
I've gotten something for this together that seems to be working, the only issue right now is that it breaks the MICE tests. @kshedden and I are actually meeting tomorrow and I was planning to submit a PR after we talk.
Basically the way it is working right now is in line with what you mentioned in the initial comment. I've duplicated a version of _prediction from regression that works for PHReg and have modified the tests to account for both possible versions of the predict. Given that there is some overlap with the code now for get_prediction it might be worth it to put together a more abstract version.
josef-pkt commentedon May 3, 2016
@lbybee thanks for the update.
IIRC:
Mice is special casing the predict method of PHReg which won't be needed anymore once predict follows the standard pattern.
The special casing in base.Results.predict uses an attribute instead of isinstance check which is not directly affected by changes in PHReg predict, but the special casing can be removed when PHReg.predict is standardized.
About your new get_prediction: Is there just code duplication/overlap, or do you want to change parts of the API to fit your case?
lbybee commentedon May 3, 2016
Ok, sounds good.
It isn't a complete duplicate or subset of the other get_prediction, there were some changes that needed to be made to make it play nice with PHReg, but they were fairly small changes.