コード例 #1
0
ファイル: ld_adaptive.py プロジェクト: orenlivne/euler
def r2(x, y):
    '''Calculate the Pearson correlation coefficient between the vectors x and y.'''
#    print x, y
#    print corrcoef(x, y)
    return corrcoef(x, y)[0][1] ** 2
コード例 #2
0
ファイル: ld_prune_rachel.py プロジェクト: orenlivne/euler
def r2(x, y):
    '''Calculate the Pearson correlation coefficient between the vectors x and y.'''
    has_data = (x >= 0) & (y >= 0)
    return corrcoef(x[has_data], y[has_data])[0][1] ** 2
コード例 #3
0
ファイル: ld_prune.py プロジェクト: orenlivne/ober
def r2(x, y):
    """Calculate the Pearson correlation coefficient between the vectors x and y using numpy."""
    has_data = (x >= 0) & (y >= 0)
    return corrcoef(x[has_data], y[has_data])[0][1] ** 2
コード例 #4
0
ファイル: ld_prune.py プロジェクト: orenlivne/ober
def r2(x, y):
    '''Calculate the Pearson correlation coefficient between the vectors x and y using numpy.'''
    has_data = (x >= 0) & (y >= 0)
    return corrcoef(x[has_data], y[has_data])[0][1]**2