Chi2Test
- class hypex.comparators.Chi2Test(compare_by, grouping_role=None, target_role=None, baseline_role=None, reliability=0.05, key='', calc_kwargs={})[source]
Bases:
StatHypothesisTestingChi-square test of independence for categorical targets.
Tests whether the distribution of a categorical column differs significantly between groups. Operates on raw data slices via scipy.
- Parameters:
compare_by (
Literal['groups','columns','columns_in_groups','cross','matched_pairs']) – Comparison mode ("groups","columns", etc.).grouping_role (
Optional[ABCRole]) – Role that identifies the group column.target_role (
Optional[ABCRole]) – Role that identifies the categorical target column(s).reliability (
float) – Significance level α (default 0.05).key (
Any) – Optional label for this test instance.