fairlens.metrics.kruskal_wallis#

kruskal_wallis(sr_a, sr_b)[source]#

Metric that uses the Kruskal-Wallis H Test to obtain a p-value indicating the possibility that a categorical and numerical series are not correlated, used in heatmap generation.

Parameters
  • sr_a (pd.Series) – The categorical series to analyze, used for grouping the numerical one.

  • sr_b (pd.Series) – The numerical series to analyze.

Returns

The correlation coefficient, calculating by subtracting the p-value from 1, as the p-value is the probability that the two columns are not correlated.

Return type

float