Skip to content

[Bug] benchmarts not work for TimeToEvent dataset with ValidationError #115

@zoezhang106

Description

@zoezhang106

The error message

ValidationError: 3 validation errors for EvaluateTimeToEvent
horizons.list[float]
Input should be a valid list [type=list_type, input_value=None, input_type=NoneType]
For further information visit https://errors.pydantic.dev/2.6/v/list_type
horizons.list[int]
Input should be a valid list [type=list_type, input_value=None, input_type=NoneType]
For further information visit https://errors.pydantic.dev/2.6/v/list_type
horizons.list[is-instance[Timestamp]]
Input should be a valid list [type=list_type, input_value=None, input_type=NoneType]
For further information visit https://errors.pydantic.dev/2.6/v/list_type

  • I have checked that this issue has not already been reported.

the code is as following
from tempor.benchmarks import benchmark_models
from tempor import plugin_loader

from IPython.display import display

PBCDataSource = plugin_loader.get_class("time_to_event.pbc", plugin_type="datasource")
dataset = PBCDataSource(random_state=42).load()

results_readable, results = benchmark_models(
task_type="time_to_event",
tests=[
("model_1", plugin_loader.get("time_to_event.dynamic_deephit", n_iter=100)),
("model_2", plugin_loader.get("time_to_event.ts_coxph", n_iter=100)),
],
data=dataset,
n_splits=3,
)

print("Results in easily-readable format:")
display(results_readable)

print("Full results:\n")
for model, value in results.items():
print(f"{model}:")
display(value)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions