actableai.causal.discover.algorithms.commons package

Submodules

actableai.causal.discover.algorithms.commons.base_runner module

class actableai.causal.discover.algorithms.commons.base_runner.CausalDiscoveryRunner(p: actableai.causal.discover.algorithms.payloads.CausalDiscoveryPayload, progress_callback: Optional[Callable[[float], None]] = None)

Bases: abc.ABC

abstract do_causal_discovery() Dict[str, list]
register_progress_callback(progress_callback: Optional[Callable[[float], None]] = None) None
run() Dict[str, list]

actableai.causal.discover.algorithms.commons.pandas_dataset_loader module

class actableai.causal.discover.algorithms.commons.pandas_dataset_loader.PandasDatasetLoader(dataset_dir: str)

Bases: causica.datasets.csv_dataset_loader.CSVDatasetLoader

Load a dataset from a Pandas object

load_predefined_dataset(max_num_rows: Optional[int] = None, negative_sample: bool = False, **kwargs) causica.datasets.dataset.Dataset

Load the data from disk and use the predefined train/val/test split to instantiate a dataset. :param max_num_rows: Maximum number of rows to include when reading data files. :param negative_sample: Whether to perform negative sampling after loading the dataset. Negative sampling requires

a file negative_sampling_levels.csv in the dataset folder, and negative samples for each row will be drawn from features of a greater level than all those observed in the row.
Returns
Dataset object, holding the data and variable metadata.
Return type
dataset
split_data_and_load_dataset(pandas_data: pandas.core.frame.DataFrame, test_frac: float, val_frac: float, random_state: Union[int, Tuple[int, int]], max_num_rows: Optional[int] = None, negative_sample: bool = False, **kwargs) causica.datasets.dataset.Dataset

Load the data from memory and make the train/val/test split to instantiate a dataset. The data is split deterministically given the random state. If the given random state is a pair of integers, the first is used to extract test set and the second is used to extract the validation set from the remaining data. If only a single integer is given as random state it is used for both. :param test_frac: Fraction of data to put in the test set. :param val_frac: Fraction of data to put in the validation set. :param random_state: An integer or a tuple of integers to be used as the splitting random state. :param max_num_rows: Maximum number of rows to include when reading data files. :param negative_sample: Whether to perform negative sampling after loading the dataset. Negative sampling requires

a file negative_sampling_levels.csv in the dataset folder, and negative samples for each row will be drawn from features of a greater level than all those observed in the row.
Returns
Dataset object, holding the data and variable metadata.
Return type
dataset

Module contents