Example #1
0
def test_compare_yield():
    """

    Tests :meth:`bet.postProcess.postTools.compare_yield` without column headings

    """
    sample_quality = np.random.random((10,))
    sort_ind = np.argsort(sample_quality)
    run_param = []
    for i in range(10):
        run_param.append(np.random.random((4,)))
    try:
        postTools.compare_yield(sort_ind, sample_quality, run_param)
        go = True
    except (RuntimeError, TypeError, NameError):
        go = False
    nptest.assert_equal(go, True)
Example #2
0
def test_compare_yield():
    """

    Tests :meth:`bet.postProcess.postTools.compare_yield` without column headings

    """
    sample_quality = np.random.random((10, ))
    sort_ind = np.argsort(sample_quality)
    run_param = []
    for i in range(10):
        run_param.append(np.random.random((4, )))
    try:
        postTools.compare_yield(sort_ind, sample_quality, run_param)
        go = True
    except (RuntimeError, TypeError, NameError):
        go = False
    nptest.assert_equal(go, True)
Example #3
0
def test_compare_yield_CH():
    """

    Tests :meth:`bet.postProcess.postTools.compare_yield` with column headings

    """
    sample_quality = np.random.random((10,))
    sort_ind = np.argsort(sample_quality)
    run_param = []
    for i in range(10):
        run_param.append(np.random.random((4,)))
    column_headings = ['swallow', 'coconut', 'ni', 'shrubbery']
    try:
        postTools.compare_yield(sort_ind, sample_quality, run_param,
                column_headings)
        go = True
    except (RuntimeError, TypeError, NameError):
        go = False
    nptest.assert_equal(go, True)
Example #4
0
def test_compare_yield_CH():
    """

    Tests :meth:`bet.postProcess.postTools.compare_yield` with column headings

    """
    sample_quality = np.random.random((10, ))
    sort_ind = np.argsort(sample_quality)
    run_param = []
    for i in range(10):
        run_param.append(np.random.random((4, )))
    column_headings = ['swallow', 'coconut', 'ni', 'shrubbery']
    try:
        postTools.compare_yield(sort_ind, sample_quality, run_param,
                                column_headings)
        go = True
    except (RuntimeError, TypeError, NameError):
        go = False
    nptest.assert_equal(go, True)
Example #5
0
# Run with varying transition sets bounds
init_ratio = [0.1, 0.25, 0.5]
min_ratio = [2e-3, 2e-5, 2e-8]
max_ratio = [.5, .75, 1.0]
tk_results = sampler.run_tk(init_ratio, min_ratio, max_ratio, rho_D,
        maximum, param_domain, kernel_rD, sample_save_file)

# Run with varying increase/decrease ratios and tolerances for a rhoD_kernel
increase = [1.0, 2.0, 4.0]
decrease = [0.5, 0.5e2, 0.5e3]
tolerance = [1e-4, 1e-6, 1e-8]
incdec_results = sampler.run_inc_dec(increase, decrease, tolerance, rho_D,
        maximum, param_domain, transition_set, sample_save_file)

# Compare the quality of several sets of samples
result_list = [gen_results, tk_results, incdec_results]

print("Compare yield of sample sets with various kernels")
ptools.compare_yield(gen_results[3], gen_results[2], gen_results[4])
print("Compare yield of sample sets with various transition sets bounds")
ptools.compare_yield(tk_results[3], tk_results[2], tk_results[4])
print("Compare yield of sample sets with variouos increase/decrease ratios")
ptools.compare_yield(incdec_results[3], incdec_results[2], incdec_results[4])

# Read in points_ref and plot results
p_ref = mdat['points_true']
p_ref = p_ref[:, 14]


Example #6
0
#        t_kernel, sample_save_file, reseed=3)

# Run with varying transition sets bounds
init_ratio = [0.1, 0.25, 0.5]
min_ratio = [2e-3, 2e-5, 2e-8]
max_ratio = [.5, .75, 1.0]
tk_results = sampler.run_tk(init_ratio, min_ratio, max_ratio, rho_D, maximum,
                            param_domain, kernel_rD, sample_save_file)

# Run with varying increase/decrease ratios and tolerances for a rhoD_kernel
increase = [1.0, 2.0, 4.0]
decrease = [0.5, 0.5e2, 0.5e3]
tolerance = [1e-4, 1e-6, 1e-8]
incdec_results = sampler.run_inc_dec(increase, decrease, tolerance, rho_D,
                                     maximum, param_domain, transition_set,
                                     sample_save_file)

# Compare the quality of several sets of samples
result_list = [gen_results, tk_results, incdec_results]

print("Compare yield of sample sets with various kernels")
ptools.compare_yield(gen_results[3], gen_results[2], gen_results[4])
print("Compare yield of sample sets with various transition sets bounds")
ptools.compare_yield(tk_results[3], tk_results[2], tk_results[4])
print("Compare yield of sample sets with variouos increase/decrease ratios")
ptools.compare_yield(incdec_results[3], incdec_results[2], incdec_results[4])

# Read in points_ref and plot results
p_ref = mdat['points_true']
p_ref = p_ref[:, 14]