コード例 #1
0
def job_hotelling(sample_source, tr, te, r):
    """Hotelling T-squared test"""
    with util.ContextTimer() as t:
        htest = tst.HotellingT2Test(alpha=alpha)
        result = htest.perform_test(te)
    return {'test_method': htest, 
            'test_result': result,
            'time_secs': t.secs}
コード例 #2
0
def job_hotelling(prob_label, tr, te, r, ni, n):
    """Hotelling T-squared test"""
    with util.ContextTimer() as t:
        htest = tst.HotellingT2Test(alpha=alpha)
        test_result = htest.perform_test(te)
    return {
        'test_method': htest,
        'test_result': test_result,
        'time_secs': t.secs
    }
コード例 #3
0
def job_hotelling(sample_source, tr, te, r):
    """Hotelling T-squared test"""
    # Since text data are high-d, T-test will likely cause a LinAlgError because 
    # of the singular covariance matrix.
    htest = tst.HotellingT2Test(alpha=alpha)
    try:
        test_result = htest.perform_test(te)
    except np.linalg.linalg.LinAlgError:
        test_result = {'alpha': alpha, 'pvalue': 1.0, 'test_stat': 1e-5,
                'h0_rejected':  False}
    result = {'test_method': htest, 'test_result': test_result}
    return result
コード例 #4
0
def job_hotelling(sample_source, tr, te, r):
    """Hotelling T-squared test"""
    htest = tst.HotellingT2Test(alpha=alpha)
    return htest.perform_test(te)
コード例 #5
0
def job_hotelling(prob_label, tr, te, r, ni, n):
    """Hotelling T-squared test"""
    htest = tst.HotellingT2Test(alpha=alpha)
    return htest.perform_test(te)