当前位置: 首页>>代码示例>>Python>>正文


Python ModelEnsemble.add_policies方法代码示例

本文整理汇总了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)
开发者ID:bram32,项目名称:EMAworkbench,代码行数:23,代码来源:test_orange_functions.py

示例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])
开发者ID:bram32,项目名称:EMAworkbench,代码行数:24,代码来源:test_orange_functions.py

示例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')
开发者ID:rahalim,项目名称:EMAworkbench,代码行数:33,代码来源:flu_vensim_example.py


注:本文中的expWorkbench.ModelEnsemble.add_policies方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。