AssertionError: assert durations.shape[0] == surv.shape[1] == surv_idx.shape[0] == events.shape[0]
- Dominant language
- Python
- Stars
- 995
- Forks
- 203
- PR merge metrics
- No merged PRs in 30d
Description
[W 2023-04-23 10:28:38,810] Trial 2 failed with parameters: {'epochs': 1782, 'batch_norm': False, 'dropout': 0.3729027863986679, 'batch_size': 128, 'alpha': 0.20950098112214738, 'sigma': 0.021532851493345717, 'num_layers': 2, 'learning_rate': 0.0004455921289602272, 'optimizer_type': 'AdamWR', 'num_nodes_1': 56, 'num_nodes_2': 20} because of the following error: AssertionError().
Traceback (most recent call last):
File "[/home/anaconda3/envs/py3.7/lib/python3.7/site-packages/optuna/study/_optimize.py](https://file+.vscode-resource.vscode-cdn.net/home/anaconda3/envs/py3.7/lib/python3.7/site-packages/optuna/study/_optimize.py)", line 200, in _run_trial
value_or_values = func(trial)
File "[/tmp/ipykernel_25107/2073144205.py](https://file+.vscode-resource.vscode-cdn.net/tmp/ipykernel_25107/2073144205.py)", line 132, in objective
c_index = ev.concordance_td('antolini')
File "[/home/anaconda3/envs/py3.7/lib/python3.7/site-packages/pycox/evaluation/eval_surv.py](https://file+.vscode-resource.vscode-cdn.net/home/anaconda3/envs/py3.7/lib/python3.7/site-packages/pycox/evaluation/eval_surv.py)", line 191, in concordance_td
self._duration_idx(), method)
File "[/home/anaconda3/envs/py3.7/lib/python3.7/site-packages/pycox/evaluation/concordance.py](https://file+.vscode-resource.vscode-cdn.net/home/anaconda3/envs/py3.7/lib/python3.7/site-packages/pycox/evaluation/concordance.py)", line 93, in concordance_td
assert durations.shape[0] == surv.shape[1] == surv_idx.shape[0] == events.shape[0]
AssertionError
[W 2023-04-23 10:28:38,812] Trial 2 failed with value None.
[W 2023-04-23 10:28:46,183] Trial 1 failed with parameters: {'epochs': 1947, 'batch_norm': False, 'dropout': 0.29937082041280605, 'batch_size': 256, 'alpha': 0.3882041406677713, 'sigma': 0.7061223972910085, 'num_layers': 1, 'learning_rate': 0.001519199989009398, 'optimizer_type': 'AdamW', 'num_nodes_1': 54} because of the following error: AssertionError().
Traceback (most recent call last):
File "[/home/anaconda3/envs/py3.7/lib/python3.7/site-packages/optuna/study/_optimize.py](https://file+.vscode-resource.vscode-cdn.net/home/huixian/anaconda3/envs/py3.7/lib/python3.7/site-packages/optuna/study/_optimize.py)", line 200, in _run_trial
value_or_values = func(trial)
File "[/tmp/ipykernel_25107/2073144205.py](https://file+.vscode-resource.vscode-cdn.net/tmp/ipykernel_25107/2073144205.py)", line 132, in objective
c_index = ev.concordance_td('antolini')
File "[/home/anaconda3/envs/py3.7/lib/python3.7/site-packages/pycox/evaluation/eval_surv.py](https://file+.vscode-resource.vscode-cdn.net/home/anaconda3/envs/py3.7/lib/python3.7/site-packages/pycox/evaluation/eval_surv.py)", line 191, in concordance_td
self._duration_idx(), method)
File "[/home/anaconda3/envs/py3.7/lib/python3.7/site-packages/pycox/evaluation/concordance.py](https://file+.vscode-resource.vscode-cdn.net/home/anaconda3/envs/py3.7/lib/python3.7/site-packages/pycox/evaluation/concordance.py)", line 93, in concordance_td
assert durations.shape[0] == surv.shape[1] == surv_idx.shape[0] == events.shape[0]
AssertionError
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with pycox/evaluation/eval_surv.py at concordance_td('antolini') and pycox/evaluation/concordance.py around the reported assertion. Reproduce the failure from the Optuna objective using the supplied durations, survival predictions, indexes, and events, then trace why their dimensions differ. Done means the mismatch is explained and the relevant evaluation behavior is covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100