Tabular Tansform module

causalai.data.transforms.tabular

class causalai.data.transforms.tabular.StandardizeTransform(with_mean: bool = True, with_std: bool = True)

Standardize tabular data by subtracting mean and dividing by standard deviation

__init__(with_mean: bool = True, with_std: bool = True)
Parameters:
  • with_mean (bool) -- subtract mean from data if True

  • with_std (bool) -- scale data by its standard deviation if True

fit(*data: List[ndarray]) None

Function that transforms the data arrays and stores any transformation parameter associated with the transform as a class attribute (i.e., mean, variance). StandardScaler ignores any NaN values along a column when computing column mean and standard deviation.

Parameters:

data (ndarray) -- Numpy array of shape (observations N, variables D)

transform(*data: List[ndarray]) List[ndarray] | ndarray

Function that returns the transformed data array list using the transform learned using the fit function

Parameters:

data (ndarray) -- Numpy array of shape (observations N, variables D)

Returns:

transformed data

Return type:

ndarray or list of ndarray