IndexError during compute_residuals
See original GitHub issueHi Cam,
I successfully fitted a survival regression (CoxPHFitter
) on my data. However, I cannot compute the shoenfeld (_compute_schoenfeld
called by residuals = self.compute_residuals(training_df, kind="scaled_schoenfeld")
) and get the following error:
df = pd.DataFrame(schoenfeld_residuals[E, :], columns=self.hazards_.columns, index=index[E])
IndexError: boolean index did not match indexed array along dimension 0; dimension is 3654 but corresponding boolean dimension is 3743
The error come from schoenfeld_residuals[E, :]
with schoenfeld_residuals
of shape (3654, 6)
and E
(3743,)
.
I guess E
correspond to the event and this a censorship issue?
This seems related to this issue.
By the way, thank you very much for lifelines–I didn’t know much on survival analysis and was ready in no time thank to the clear api and docs.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top Results From Across the Web
IndexError: index 1 is out of bounds for axis 0 with size 1. and ...
Cb has length 1 on shape[0], therefore that causes an index out of bound exception when i reached value 1.
Read more >OpenMDAO/group.py at master - GitHub
Object used to allocate MPI processes to subsystems. _proc_info : dict of subsys_name: (min_procs, max_procs, weight, proc_group). Information used to determine ...
Read more >Python indexerror: list index out of range Solution
In this tutorial, we're going to talk about the “indexerror: list index out of range” error. We'll discuss how it works and walk...
Read more >Source code for pint.residuals
Source code for pint.residuals. """Objects for comparing models to data. These objects can be constructed directly, as ``Residuals(toas, model)``, ...
Read more >COMP1730/COMP6730: Programming for Scientists
Indexing is done by writing the index in square brackets after the sequence value, like so: ... IndexError: list index out of bounds...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
AFAIK, this is fixed
Everything is working fine with the fix, thanks!