Resplitter

ResplitBuilder

Builds stratification split for DataFrame.

ResplitParams

Resplit params class.

Resplit Builder

class abacus.resplitter.ResplitBuilder(df: DataFrame, resplit_params: ResplitParams)[source]

Builds stratification split for DataFrame.

Methods

collect()

Method recalculate fractions of each strata in dataframe.

abacus.resplitter.ResplitBuilder.collect(self) DataFrame

Method recalculate fractions of each strata in dataframe.

Returns:

DataFrame with recalculated strata fractions.

Return type:

pandas.DataFrame

Params

class abacus.resplitter.ResplitParams(group_names: GroupNames, strata_col: str = 'strata', group_col: str = 'group_col')[source]

Resplit params class.

Parameters:
  • group_names (GroupNames) – group names

  • strata_col (str) – name of column with strata

  • group_col (str) – name of column with groups split