Skip to content
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

Fix piecewise hazard prediction #1268

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

griffiri
Copy link

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...

@@ -2873,7 +2873,7 @@ def test_efron_newtons_method(self, data_nus, cph):
assert np.abs(newton(X, T, E, W, entries)[0] - -0.0335) < 0.0001


class TestCoxPHFitterPeices:
class TestCoxPHFitterPieces:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hehe ty

@CamDavidsonPilon
Copy link
Owner

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
Copy link
Owner

Also PR workflow is perfect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants