3.7.3.6. renom.utility.evaluation.cramer_coefficient package

class CramerCoefficient ( x , y )

行カテゴリーと列カテゴリーの連関を表すクラメールの連関係数を返す

パラメータ:
  • x ( array ) – values of class
  • y ( array ) – values of class
Return float_or_list:

クラメールの連関係数

Example:
>>> from renom.utility.evaluation.cramer_coefficient.cramer_coefficient import CramerCoefficient
>>> a = ['cat', 'cat', 'cat', 'cat', 'dog', 'dog', 'dog', 'dog']
>>> b = ['m','m','m','m','f','f','f','m'] 
>>> hoge = CramerCoefficient(a, b)
>>> hoge.evaluate()
0.7745966692414834
>>> c = np.array([['m','m','m','m','f','f','f','m'],['m','m','m','m','f','f','f','m']]).T
>>> hoge = CramerCoefficient(a, c)
>>> hoge.evaluate()
[0.7745966692414834, 0.7745966692414834]
evaluate ( )

クラメールの連関係数を返す

Return float_or_list:

クラメールの連関係数

Example:
>>> from renom.utility.evaluation.cramer_coefficient.cramer_coefficient import CramerCoefficient
>>> a = ['cat', 'cat', 'cat', 'cat', 'dog', 'dog', 'dog', 'dog']
>>> b = ['m','m','m','m','f','f','f','m'] 
>>> hoge = CramerCoefficient(a, b)
>>> hoge.evaluate()
0.7745966692414834
>>> c = np.array([['m','m','m','m','f','f','f','m'],['m','m','m','m','f','f','f','m']]).T
>>> hoge = CramerCoefficient(a, c)
>>> hoge.evaluate()
[0.7745966692414834, 0.7745966692414834]
cramer_coefficient ( x , y )

行カテゴリーと列カテゴリーの連関を表すクラメールの連関係数を返す

パラメータ:
  • x ( array ) – values of class
  • y ( array ) – values of class
Return float_or_list:

クラメールの連関係数

Example:
>>> from renom.utility.evaluation.cramer_coefficient.cramer_coefficient import cramer_coefficient
>>> a = ['cat', 'cat', 'cat', 'cat', 'dog', 'dog', 'dog', 'dog']
>>> b = ['m','m','m','m','f','f','f','m'] 
>>> cramer_coefficient(a,b)
0.7745966692414834
>>> c = np.array([['m','m','m','m','f','f','f','m'],['m','m','m','m','f','f','f','m']]).T
>>> cramer_coefficient(a,c)
[0.7745966692414834, 0.7745966692414834]