Comments (10)
aha! yes, either add a small non-zero factor 1e-4
or something like that, or just add a constant value to every time to change the scale to be strictly positive.
from auton-survival.
yeah we use scikit-survival for the underlying metrics computation. Try shuffling your CV folds ? It might help, essentially computing performance for the models requires the same range of times to be present in the training and testing folds, in the case of your dataset the smaller size leads to a fold having times beyond what it has seen in the training set
from auton-survival.
aha, maybe then stratified creation of the folds will make more sense for such small set. Closing this for now, thanks a lot!
from auton-survival.
HI @zapaishchykova DSM expects all passed times t
to be strictly greater than 0
. can you check that in your data?
from auton-survival.
Hi! Here it is:
times = np.quantile(outcomes.time[outcomes.event==1], [0.25, 0.5, 0.6]).tolist()
times
[13.0, 27.0, 35.0]
from auton-survival.
can you check if there are any zeros in outcomes.time
from auton-survival.
there are indeed some zeros in the outcomes.time ! Should I replace them with some small value instead?
from auton-survival.
Some progress, now I get different error:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In [48], line 18
16 roc_auc = []
17 for i, _ in enumerate(times):
---> 18 roc_auc.append(cumulative_dynamic_auc(et_train, et_test, out_risk[:, i], times[i])[0])
19 for horizon in enumerate(horizons):
20 print(f"For {horizon[1]} quantile,")
File ~/miniconda3/envs/pycox310/lib/python3.10/site-packages/sksurv/metrics.py:468, in cumulative_dynamic_auc(survival_train, survival_test, estimate, times, tied_tol)
466 cens = CensoringDistributionEstimator()
467 cens.fit(survival_train)
--> 468 ipcw = cens.predict_ipcw(survival_test)
470 # expand arrays to (n_samples, n_times) shape
471 test_time = numpy.broadcast_to(test_time[:, numpy.newaxis], (n_samples, n_times))
File ~/miniconda3/envs/pycox310/lib/python3.10/site-packages/sksurv/nonparametric.py:448, in CensoringDistributionEstimator.predict_ipcw(self, y)
445 Ghat = self.predict_proba(time[event])
447 if (Ghat == 0.0).any():
--> 448 raise ValueError("censoring survival function is zero at one or more time points")
450 weights = numpy.zeros(time.shape[0])
451 weights[event] = 1.0 / Ghat
ValueError: censoring survival function is zero at one or more time points
from auton-survival.
Are you trying to perform Cross Validation? is this a relatively small dataset?
from auton-survival.
It is a small dataset!
Interestingly, with this dataset using scikit-survival I was also unable to compute ROC with similar looking error
from auton-survival.
Related Issues (20)
- Jupyter notebook for competing risk demo 0 HOT 1
- Supervised Phenotyping with Deep Cox Mixtures (DCM)-How to check phenotype characteristics HOT 1
- saving models? HOT 1
- Calculate log partial likelihood for the DCM HOT 2
- Add pyproject.toml to root dir to facilitate install as VCS or local dependency HOT 1
- Stacking DCM and DSM HOT 1
- Plotting predicted probability versus actual probability at different time points HOT 1
- error with DCM: PROBABILITY TENSOR HOT 1
- Enable federated learning with DeepCoxPH
- Remove DSM
- Fix non-PEP indentation
- AttributeError: module 'auton_survival' has no attribute 'plot_kaplanmeier' HOT 4
- ValueError: could not convert string to float: 'Rural Adj' HOT 2
- Age feature in pbc2 HOT 1
- Error in the example notebook: 'RandomSurvivalForest' object has no attribute 'event_times_' HOT 1
- opened by mistake
- Unable to install package HOT 2
- AssertionError: Times should be within the range of event times to avoid exterpolation HOT 2
- Error in DSM on Support Dataset notebook HOT 1
- Error with CMHE model
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 auton-survival.