Source code for tempor.datasources.treatments.one_off.plugin_pkpd
"""Module for the PKPD data source plugin."""fromtypingimportAny,castfromtempor.coreimportpluginsfromtempor.dataimportdatasetfromtempor.data.clv2convimportclairvoyance2_dataset_to_tempor_datasetfromtempor.datasourcesimportdatasourcefromtempor.models.clairvoyance2.datasets.simulated.simple_pkpdimportsimple_pkpd_dataset
[docs]@plugins.register_plugin(name="pkpd",category="treatments.one_off",plugin_type="datasource")classPKPDDataSource(datasource.OneOffTreatmentEffectsDataSource):def__init__(self,n_timesteps:int=10,time_index_treatment_event:int=7,n_control_samples:int=20,n_treated_samples:int=20,random_state:int=100,**kwargs:Any,)->None:"""PKPD data source for one-off treatment effects tasks. Adapted from: https://github.com/ZhaozhiQIAN/SyncTwin-NeurIPS-2021 Args: n_timesteps (int, optional): Number of timesteps. Defaults to ``10``. time_index_treatment_event (int, optional): Time index of the treatment event. Defaults to ``7``. n_control_samples (int, optional): Number of control samples to generate. Defaults to ``20``. n_treated_samples (int, optional): Number of treated samples to generate. Defaults to ``20``. random_state (int, optional): Random state to use. Defaults to ``100``. **kwargs (Any): Any additional keyword arguments will be passed to parent constructor. Reference: Qian, Z., Zhang, Y., Bica, I., Wood, A., & van der Schaar, M. (2021). Synctwin: Treatment effect \ estimation with longitudinal outcomes. Advances in Neural Information Processing Systems, 34, 3178-3190. """super().__init__(**kwargs)self.n_timesteps=n_timestepsself.time_index_treatment_event=time_index_treatment_eventself.n_control_samples=n_control_samplesself.n_treated_samples=n_treated_samplesself.random_state=random_state