Comments (3)
'surv' dataframe has the index as follows:
[0.000e+00 1.000e+00 5.000e+00 8.000e+00 1.000e+01 2.100e+01 2.400e+01
...]
However, in normal cases: surv seems to begin with [-7 0 1 5 8].
When I tried to print out the self.index_surv in eval_surv, it shows:
[ 0.000e+00 -7.000e+00 0.000e+00 5.000e+00 4.900e+01 7.000e+01
2.000e+02 2.220e+02 2.580e+02 3.260e+02 3.390e+02 3.660e+02
3.750e+02 3.760e+02 3.800e+02 3.850e+02 3.930e+02 3.940e+02
4.040e+02 4.080e+02 4.100e+02 4.280e+02 4.310e+02 4.330e+02
4.390e+02 4.460e+02 4.480e+02 4.610e+02 4.630e+02 4.670e+02
4.710e+02 4.770e+02 4.880e+02 5.040e+02 5.230e+02 5.240e+02
5.380e+02 5.620e+02 5.680e+02 5.770e+02 5.840e+02 5.850e+02
5.910e+02 5.980e+02 6.070e+02 6.120e+02 6.140e+02 6.160e+02
6.270e+02 6.430e+02 6.460e+02 6.590e+02 6.790e+02 6.940e+02
7.140e+02 7.150e+02 7.270e+02 7.520e+02 7.950e+02 8.200e+02
9.070e+02 9.120e+02 9.650e+02 9.720e+02 9.870e+02 1.001e+03
1.010e+03 1.013e+03 1.032e+03 1.101e+03 1.133e+03 1.185e+03
1.189e+03 1.220e+03 1.234e+03 1.246e+03 1.275e+03 1.325e+03
1.326e+03 1.363e+03 1.417e+03 1.471e+03 1.523e+03 1.545e+03
1.550e+03 1.563e+03 1.596e+03 1.604e+03 1.611e+03 1.620e+03
1.688e+03 1.759e+03 1.820e+03 1.847e+03 1.871e+03 1.882e+03
1.935e+03 2.108e+03 2.109e+03 2.193e+03 2.371e+03 2.486e+03
2.489e+03 2.534e+03 2.629e+03 2.645e+03 2.712e+03 2.965e+03
2.976e+03 2.989e+03 3.203e+03 3.204e+03 3.660e+03 3.669e+03
3.736e+03 3.959e+03 4.047e+03 5.176e+03]
from pycox.
Thank you for the reported bug and the kind words!
So I don't really know whats wrong, but I have some ideas.
Are any of your durations
negative? We've generally assumed that duration (time) starts at zero, so having negative durations might cause some unexpected results. If this is the case, replacing this should work
from pycox.utils import kaplan_meier
censor_surv = kaplan_meier(durations, 1-events, durations.min())
ev = EvalSurv(surv, durations, events, censor_surv=censor_surv)
return ev.concordance_td()
It might, however, be better to use durations that are non-negative.
Finally, if you only want the concordance ev.concordance_td()
you, don't need censoring estimates at all. So you can just leave the censor_surv
argument empty (and save some unnecessary computation)
ev = EvalSurv(surv, durations, events)
return ev.concordance_td()
Does this help?
from pycox.
Yes, thanks a lot for the valuable suggestions! The data indeed contains negative observation time. It works fine after removing those observations.
from pycox.
Related Issues (20)
- L1 and L2 penalty coxph HOT 1
- AssertionError: assert durations.shape[0] == surv.shape[1] == surv_idx.shape[0] == events.shape[0]
- METABRIC Covariates Subset HOT 1
- AttributeError: 'Series' object has no attribute 'is_monotonic' HOT 18
- about hazard value! HOT 2
- Reproduction of the results in JMLR19 paper HOT 1
- Calculating Estimated Population Survival Curve HOT 4
- Some question about the result of deephit_competing_risks HOT 2
- AttributeError: 'DeepHitSingle' object has no attribute 'state_dict' HOT 1
- ValueError: cannot convert float NaN to integer HOT 1
- Softmax layer and residual connections in DeepHitSingle model HOT 1
- _initialization of _internal failed
- TypeError: forward() missing 1 required positional argument: 'events'
- ValueError: cannot convert float NaN to integer HOT 1
- A model to add
- Auto-encoder pycox implementation for 3D images instead of tabular data
- performance for ordinal categorical covariates
- what kind of model in pycox works for sequential patterns
- Newton-Raphson optimization
- [Installation] python setup.py egg_info did not run successfully HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pycox.