本文整理汇总了Python中expWorkbench.ModelEnsemble.add_policies方法的典型用法代码示例。如果您正苦于以下问题:Python ModelEnsemble.add_policies方法的具体用法?Python ModelEnsemble.add_policies怎么用?Python ModelEnsemble.add_policies使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类expWorkbench.ModelEnsemble
的用法示例。
在下文中一共展示了ModelEnsemble.add_policies方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_tree
# 需要导入模块: from expWorkbench import ModelEnsemble [as 别名]
# 或者: from expWorkbench.ModelEnsemble import add_policies [as 别名]
def test_tree():
log_to_stderr(level= INFO)
model = FluModel(r'..\..\models\flu', "fluCase")
ensemble = ModelEnsemble()
ensemble.parallel = True
ensemble.set_model_structure(model)
policies = [{'name': 'no policy',
'file': r'\FLUvensimV1basecase.vpm'},
{'name': 'static policy',
'file': r'\FLUvensimV1static.vpm'},
{'name': 'adaptive policy',
'file': r'\FLUvensimV1dynamic.vpm'}
]
ensemble.add_policies(policies)
results = ensemble.perform_experiments(10)
a_tree = tree(results, classify)
示例2: test_feature_selection
# 需要导入模块: from expWorkbench import ModelEnsemble [as 别名]
# 或者: from expWorkbench.ModelEnsemble import add_policies [as 别名]
def test_feature_selection():
log_to_stderr(level= INFO)
model = FluModel(r'..\..\models\flu', "fluCase")
ensemble = ModelEnsemble()
ensemble.parallel = True
ensemble.set_model_structure(model)
policies = [{'name': 'no policy',
'file': r'\FLUvensimV1basecase.vpm'},
{'name': 'static policy',
'file': r'\FLUvensimV1static.vpm'},
{'name': 'adaptive policy',
'file': r'\FLUvensimV1dynamic.vpm'}
]
ensemble.add_policies(policies)
results = ensemble.perform_experiments(5000)
results = feature_selection(results, classify)
for entry in results:
print entry[0] +"\t" + str(entry[1])
示例3: model_init
# 需要导入模块: from expWorkbench import ModelEnsemble [as 别名]
# 或者: from expWorkbench.ModelEnsemble import add_policies [as 别名]
def model_init(self, policy, kwargs):
'''initializes the model'''
try:
self.model_file = policy['file']
except KeyError:
ema_logging.warning("key 'file' not found in policy")
super(FluModel, self).model_init(policy, kwargs)
if __name__ == "__main__":
ema_logging.log_to_stderr(ema_logging.INFO)
model = FluModel(r'..\..\models\flu', "fluCase")
ensemble = ModelEnsemble()
ensemble.set_model_structure(model)
#add policies
policies = [{'name': 'no policy',
'file': r'\FLUvensimV1basecase.vpm'},
{'name': 'static policy',
'file': r'\FLUvensimV1static.vpm'},
{'name': 'adaptive policy',
'file': r'\FLUvensimV1dynamic.vpm'}
]
ensemble.add_policies(policies)
ensemble.parallel = True #turn on parallel processing
results = ensemble.perform_experiments(1000)
save_results(results, r'./data/1000 flu cases.bz2')