本文整理汇总了Python中expWorkbench.ModelEnsemble.perform_maximin_optimization方法的典型用法代码示例。如果您正苦于以下问题:Python ModelEnsemble.perform_maximin_optimization方法的具体用法?Python ModelEnsemble.perform_maximin_optimization怎么用?Python ModelEnsemble.perform_maximin_optimization使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类expWorkbench.ModelEnsemble
的用法示例。
在下文中一共展示了ModelEnsemble.perform_maximin_optimization方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: maxmin_optimize
# 需要导入模块: from expWorkbench import ModelEnsemble [as 别名]
# 或者: from expWorkbench.ModelEnsemble import perform_maximin_optimization [as 别名]
def maxmin_optimize():
ema_logging.log_to_stderr(ema_logging.INFO)
model = TestModel("", 'simpleModel') #instantiate the model
ensemble = ModelEnsemble() #instantiate an ensemble
ensemble.set_model_structure(model) #set the model on the ensemble
ensemble.parallel = True
ensemble.processes = 12
def obj_function1(outcomes):
return outcomes['y']
policy_levers = { "L1": (0,1),
"L2": (0,1)}
results = ensemble.perform_maximin_optimization(obj_function1 = obj_function1,
policy_levers = policy_levers,
minimax1='minimize',
nrOfGenerations1=50,
nrOfPopMembers1=200,
minimax2 = "maximize",
nrOfGenerations2 = 50,
nrOfPopMembers2 = 100,
)
graph_errorbars_raw(results['stats'])
plt.show()