lifelines icon indicating copy to clipboard operation
lifelines copied to clipboard

Fix piecewise hazard prediction

Open griffiri opened this issue 4 years ago • 2 comments

The unit test test_estimation / TestCoxPHFitterPieces.test_predict_hazard_sans_strata fails, where i am comparing the result of predicting hazard for 1 of 5 samples to the 1 sample run by itself. This seems to be because running egrad on a matrix input isn't what we want to do (we just want to differentiate cumulative hazard along time axis). Not sure how to fix it though.

Ignore the change to pre-commit hook for the moment. It's the only way i could seem to commit files. black throws an error message i can't resolve if i leave it there. Can figure this out later...

griffiri avatar Apr 29 '21 14:04 griffiri

The code look reasonable, and I can't spot a problem by looking at it. I'm going to pull this locally to see if I can figure it out.

BTW - this specific code, the cumulative hazard function for piecewise-whatever, is very complex (and lacking comments - thanks @CamDavidsonPilon...), and I am surprised you were not scared off by it.

CamDavidsonPilon avatar Apr 29 '21 15:04 CamDavidsonPilon

Also PR workflow is perfect

CamDavidsonPilon avatar Apr 29 '21 15:04 CamDavidsonPilon