tempor.datasources.datasource module¶
Module defining the data source classes.
-
tempor.datasources.datasource.DATA_DIR =
'data'¶ The subdirectory on the user’s system where all data source files will be stored.
The full directory will be
< tempor -> config -> working_directory > / DATA_DIR.
- tempor.datasources.datasource.monkeypatch_ssl_error_workaround() Generator[source]¶
Some datasets (e.g. UCI diabetes) are hosted on servers that may have SSL issues. This is a workaround that monkeypatches the
sslmodule to ignore SSL errors temporarily.
- class tempor.datasources.datasource.DataSource(**kwargs: Any)[source]¶
-
DataSourceclass toloadaDataSet.Initializer for
DataSource.- Parameters:¶
- **kwargs : Any
Any additional keyword arguments for the
DataSource.
-
data_root_dir : ClassVar[str] =
'/home/docs/checkouts/readthedocs.org/user_builds/temporai/checkouts/latest/docs/data'¶ The automatically determined root directory for data on the user’s system. It will be
< tempor -> config -> working_directory > / data.
- abstract static dataset_dir() str | 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.
- abstract static url() str | None[source]¶
Define the URL of the data source, if relevant, otherwise return
None.
- classmethod requires_internet() bool[source]¶
A
classmethodthat returns true if theDataSourcerequires access to the Internet toload(at least before it is saved locally).Returns
Trueifcls.url()is notNone, else returnsFalse.- Returns:¶
Whether the
DataSourcerequires Internet access toload.- Return type:¶
- abstract property predictive_task : PredictiveTask¶
The expected predictive task of the loaded dataset.
- class tempor.datasources.datasource.OneOffPredictionDataSource(**kwargs: Any)[source]¶
Bases:
DataSourceInitializer for
DataSource.- Parameters:¶
- **kwargs : Any
Any additional keyword arguments for the
DataSource.
- property predictive_task : PredictiveTask¶
The expected predictive task of the loaded dataset. Here, it is
ONE_OFF_PREDICTION.
- class tempor.datasources.datasource.TemporalPredictionDataSource(**kwargs: Any)[source]¶
Bases:
DataSourceInitializer for
DataSource.- Parameters:¶
- **kwargs : Any
Any additional keyword arguments for the
DataSource.
- property predictive_task : PredictiveTask¶
The expected predictive task of the loaded dataset. Here, it is
TEMPORAL_PREDICTION.
- class tempor.datasources.datasource.TimeToEventAnalysisDataSource(**kwargs: Any)[source]¶
Bases:
DataSourceInitializer for
DataSource.- Parameters:¶
- **kwargs : Any
Any additional keyword arguments for the
DataSource.
- property predictive_task : PredictiveTask¶
The expected predictive task of the loaded dataset. Here, it is
TIME_TO_EVENT_ANALYSIS.
- class tempor.datasources.datasource.OneOffTreatmentEffectsDataSource(**kwargs: Any)[source]¶
Bases:
DataSourceInitializer for
DataSource.- Parameters:¶
- **kwargs : Any
Any additional keyword arguments for the
DataSource.
- property predictive_task : PredictiveTask¶
The expected predictive task of the loaded dataset. Here, it is
ONE_OFF_TREATMENT_EFFECTS.
- class tempor.datasources.datasource.TemporalTreatmentEffectsDataSource(**kwargs: Any)[source]¶
Bases:
DataSourceInitializer for
DataSource.- Parameters:¶
- **kwargs : Any
Any additional keyword arguments for the
DataSource.
- property predictive_task : PredictiveTask¶
The expected predictive task of the loaded dataset. Here, it is
TEMPORAL_TREATMENT_EFFECTS.