fklearn.data package

Submodules

fklearn.data.datasets module

fklearn.data.datasets.make_confounded_data(n: int) → Tuple[pandas.core.frame.DataFrame, pandas.core.frame.DataFrame, pandas.core.frame.DataFrame][source]

Generates fake data for counterfactual experimentation. The covariants are sex, age and severity, the treatment is a binary variable, medication and the response days until recovery.

Parameters:n (int) – The number of samples to generate
Returns:
  • df_rnd (pd.DataFrame) – A dataframe where the treatment is randomly assigned.
  • df_obs (pd.DataFrame) – A dataframe with confounding.
  • df_df (pd.DataFrame) – A counter factual dataframe with confounding. Same as df_obs, but with the treatment flipped.
fklearn.data.datasets.make_tutorial_data(n: int) → pandas.core.frame.DataFrame[source]

Generates fake data for a tutorial. There are 3 numerical features (“num1”, “num3” and “num3”) and tow categorical features (“cat1” and “cat2”) sex, age and severity, the treatment is a binary variable, medication and the response days until recovery.

Parameters:n (int) – The number of samples to generate
Returns:df – A tutorial dataset
Return type:pd.DataFrame

Module contents