Exemplo n.º 1
0
'''
Created on Mar 15, 2012

.. codeauthor:: jhkwakkel <j.h.kwakkel (at) tudelft (dot) nl>
'''

from analysis import clusterer
from util import ema_logging

from core import ModelEnsemble
from test.scarcity_example import ScarcityModel

if __name__ == "__main__":
    ema_logging.log_to_stderr(ema_logging.INFO)
    model = ScarcityModel(r'..\..\src\test', "fluCase")

    ensemble = ModelEnsemble()
    ensemble.set_model_structure(model)
    ensemble.parallel = True

    results = ensemble.perform_experiments(200)

    clusterer.cluster(data=results,
                      outcome='relative market price',
                      distance='gonenc',
                      cMethod='maxclust',
                      cValue=5,
                      plotDendrogram=False)
Exemplo n.º 2
0
'''
Created on Mar 15, 2012

@author: jhkwakkel
'''

from analysis import clusterer
from expWorkbench import ema_logging

from expWorkbench import ModelEnsemble
from test.scarcity_example import ScarcityModel

if __name__ == "__main__":
    ema_logging.log_to_stderr(ema_logging.INFO)
    model = ScarcityModel(r'..\..\src\test', "fluCase")
       
    ensemble = ModelEnsemble()
    ensemble.set_model_structure(model)
    ensemble.parallel = True
    
    results = ensemble.perform_experiments(200)
    
    clusterer.cluster(data=results, 
                      outcome='relative market price', 
                      distance='gonenc', 
                      cMethod='maxclust', 
                      cValue=5,
                      plotDendrogram=False)
Exemplo n.º 3
0
#load the data
data = load_results(r'..\gallery\data\100 flu cases no policy.cPickle')

# specify the number of desired clusters
# note: the meaning of cValue is tied to the value for cMethod
cValue = 5

#perform cluster analysis
dist, clusteraloc, runlog, z = cluster(data=data, 
                                    outcome='deceased population region 1', 
                                    distance='gonenc', 
                                    interClusterDistance='complete', 
                                    cMethod = 'maxclust',
                                    cValue = cValue,
                                    plotDendrogram=False, 
                                    plotClusters=False, 
                                    groupPlot=False,
                                    sisterCount=100,
                                    tHoldCurvature = 0.1,
                                    tHoldSlope = 0.1
                                    )

#the plotting
fig = plt.figure()

#for each cluster
for i in range(1, cValue+1):
    #get the data
    values  = data[1]['deceased population region 1']
    values = values[clusteraloc==i]
Exemplo n.º 4
0
'''
Created on Sep 8, 2011

@author: gonengyucel
'''

from analysis.clusterer import cluster

from expWorkbench import load_results
from expWorkbench import EMAlogging

EMAlogging.log_to_stderr(EMAlogging.INFO)

data = load_results(r'..\analysis\1000 flu cases.cPickle')

cluster(data=data, 
        outcome='deceased population region 1', 
        distance='gonenc', 
        interClusterDistance='complete', 
        plotDendrogram=True, 
        plotClusters=False, 
        groupPlot=False,
        sisterCount=100,
        )