tempor.datasources.treatments.temporal.plugin_dummy_treatments module

Module with the dummy data source for temporal treatment effects.

class tempor.datasources.treatments.temporal.plugin_dummy_treatments.DummyTemporalTreatmentEffectsDataSource(n_samples: int = 100, temporal_covariates_n_features: int = 5, temporal_covariates_max_len: int = 20, temporal_covariates_missing_prob: float = 0.1, static_covariates_n_features: int = 3, static_covariates_missing_prob: float = 0.0, temporal_targets_n_features: int = 2, temporal_targets_n_categories: int | None = None, temporal_treatments_n_features: int = 2, temporal_treatments_n_categories: int | None = None, random_state: int = 12345, **kwargs: Any)[source]

Bases: TemporalTreatmentEffectsDataSource

Dummy data source for temporal treatment effects tasks; generates a dataset with random data.

Parameters:
n_samples : int, optional

Number of samples. Defaults to 100.

temporal_covariates_n_features : int, optional

Number of time series covariates features. Defaults to 5.

temporal_covariates_max_len : int, optional

Maximum number of time steps in time series covariates. Defaults to 20.

temporal_covariates_missing_prob : float, optional

The missingness probability of time series covariates. Defaults to 0.1.

static_covariates_n_features : int, optional

Number of static covariates features. Defaults to 3.

static_covariates_missing_prob : float, optional

The missingness probability of static covariates. Defaults to 0.0.

temporal_targets_n_features : int, optional

Number of time series target features. Defaults to 2.

temporal_targets_n_categories : Optional[int], optional

Number of categories in time series targets features. If None, the target features will be real rather than categorical. Defaults to None.

temporal_treatments_n_features : int, optional

Number of time series treatment features. Defaults to 2.

temporal_treatments_n_categories : Optional[int], optional

Number of categories in time series treatment features. If None, the target features will be real rather than categorical. Defaults to None.

random_state : int, optional

Random state to use. Defaults to 12345.

**kwargs : Any

Any additional keyword arguments will be passed to DataSource.

static url() None[source]

Define the URL of the data source, if relevant, otherwise return None.

Returns:

The URL of the data source, if relevant, otherwise None.

Return type:

Optional[str]

static dataset_dir() None[source]

The path to the directory where the data file(s) will be stored, if relevant. If the data source has no data files, return None.

Note

the path should correspond to a subdirectory within data_root_dir.

Returns:

The path of the directory where the data file(s) will be stored, if relevant, else None.

Return type:

Optional[str]

load(**kwargs: Any) TemporalTreatmentEffectsDataset[source]

The method that should return a temporal treatment effects dataset.

Parameters:
**kwargs : Any

Any additional keyword arguments.

Returns:

The loaded dataset.

Return type:

dataset.TemporalTreatmentEffectsDataset

category : ClassVar[plugin_typing.PluginCategory] = 'treatments.temporal'

Plugin category, such as 'prediction.one_off.classification'. Must be set by the plugin class using @register_plugin.

name : ClassVar[plugin_typing.PluginName] = 'dummy_treatments'

Plugin name, such as 'my_nn_classifier'. Must be set by the plugin class using @register_plugin.

plugin_type : ClassVar[plugin_typing.PluginTypeArg] = 'datasource'

Plugin type, such as 'method'. May be optionally set by the plugin class using @register_plugin, else will set the default plugin type.