Exemple #1
0
single_component_data_path = test_data_dir + "/data/test/single_component_complete_track.txt"
double_component_data_path = test_data_dir + "/data/test/double_component_complete_track.txt"
single_component_incom_data_path = test_data_dir + "/data/test/single_component_incomplete_track.txt"
double_component_incom_data_path = test_data_dir + "/data/test/double_component_incomplete_track.txt"

from solver.vanilla_MLC import RunVanillaMLC
from solver.predict_performance import get_predict_performance
import numpy as np

test_instance = RunVanillaMLC()

"""
single component test
"""
# initialize
test_instance.init(1)
test_instance.load_data(single_component_data_path)
# solve
res = test_instance.solve()
# print result
print([0.2, 0.4, 0.6, 0.8, 0.9])  # truth
print(res["q"])  # estimated

# compare the performance
print(get_predict_performance(test_instance.response_data, res["q"], res["p"]))


"""
double component test
"""
# initialize
Exemple #2
0
single_component_data_path = test_data_dir + '/data/test/single_component_complete_track.txt'
double_component_data_path = test_data_dir + '/data/test/double_component_complete_track.txt'


from solver.vanilla_MLC import RunVanillaMLC

test_instance = RunVanillaMLC()

'''
single component test
'''
# initialize
test_instance.load_param(1)
test_instance.load_data(single_component_data_path)
# initialize
test_instance.init()
# solve
test_instance.solve_EM()
# print result
print([0.2,0.4,0.6,0.8,0.9])  # truth
print(test_instance.learning_curve_matrix[0])  # estimated

'''
double component test
'''
# initialize
test_instance.load_param(2)
test_instance.load_data(double_component_data_path)
# initialize
test_instance.init()
# solve