def run_trial_with_objective(objective_type_data): """Run a trial given the combination of the objective type and dataset""" objective_type, data = objective_type_data print("Learning with squared error + fairness_{}".format(objective_type)) types = set([objective_type]) if objective_type == 'Over+Under': types = set(['Underestimation', 'Overestimation']) learner = Learner(data, d, lam=1e-3) learner.learn(types, epochs=epoch, display=False) ####################### # Evaluating ####################### eval = Evaluator(data, learner) result_testing = eval.error_fairness() result_training = eval.error_fairness_training() return result_testing, result_training