theil_u_correlation#

theil_u_correlation(x: Union[List, ndarray, Series], y: Union[List, ndarray, Series]) float[source]#

Calculate the Theil’s U correlation of y to x.

Theil’s U is an asymmetric measure ranges [0,1] based on entropy which answers the question: how well does variable y explains variable x? For more information see https://en.wikipedia.org/wiki/Uncertainty_coefficient

Parameters
x: Union[List, np.ndarray, pd.Series]

A sequence of a categorical variable values without nulls

y: Union[List, np.ndarray, pd.Series]

A sequence of a categorical variable values without nulls

Returns
float

Representing the Theil U correlation between y and x