3.7.3.5. renom.utility.evaluation.correlation_ratio package

class CorrelationRatio ( category , data )

クラス(カテゴリー)とデータの相関比を返す

パラメータ:
  • category ( ndarray ) – カテゴリー(クラスラベル)
  • data ( ndarray ) – データ(数値)
Example:
>>> from utility.evaluation import CorrelationRatio
>>> import numpy as np
>>> alpha = np.array(['a', 'b', 'c', 'c', 'a', 'a', 'c', 'b', 'a', 'a','b', 'c', 'c','c', 'a', 'b', 'b', 'c', 'a', 'b', 'b', 'c', 'b'])
>>> year = np.array([41, 30, 25, 29, 37, 45, 28, 26, 40, 51,29, 23, 22, 26, 39, 32, 39, 31, 43, 38, 28, 26, 38])
>>> hoge = CorrelationRatio(category = alpha, data = year)
>>> hoge.evaluate()
0.71972852893905526
evaluate ( )

クラス(カテゴリー)とデータの相関比を返す

Return float:

相関比

Example:
>>> from utility.evaluation import CorrelationRatio
>>> import numpy as np
>>> alpha = np.array(['a', 'b', 'c', 'c', 'a', 'a', 'c', 'b', 'a', 'a','b', 'c', 'c','c', 'a', 'b', 'b', 'c', 'a', 'b', 'b', 'c', 'b'])
>>> year = np.array([41, 30, 25, 29, 37, 45, 28, 26, 40, 51,29, 23, 22, 26, 39, 32, 39, 31, 43, 38, 28, 26, 38])
>>> hoge = CorrelationRatio(category = alpha, data = year)
>>> hoge.evaluate()
0.71972852893905526
correlation_ratio ( category , data )

クラス(カテゴリー)とデータの相関比を返す

パラメータ:
  • category ( ndarray ) – カテゴリー(クラスラベル)
  • data ( ndarray ) – データ(数値)
Return float:

相関比

Example:
>>> from utility.evaluation import CorrelationRatio, correlation_ratio
>>> import numpy as np
>>> alpha = np.array(['a', 'b', 'c', 'c', 'a', 'a', 'c', 'b', 'a', 'a','b', 'c', 'c','c', 'a', 'b', 'b', 'c', 'a', 'b', 'b', 'c', 'b'])
>>> year = np.array([41, 30, 25, 29, 37, 45, 28, 26, 40, 51,29, 23, 22, 26, 39, 32, 39, 31, 43, 38, 28, 26, 38])
>>> hoge = correlation_ratio(category = alpha, data = year)
0.71972852893905526