def test_pairs_scatter():
    results = test_utilities.load_eng_trans_data()
    
    pairs_scatter(results)
    
    pairs_scatter(results, group_by='policy',
                  grouping_specifiers='basic policy', legend=False)
    
    pairs_scatter(results, group_by='policy', 
                  grouping_specifiers=['no policy', 'adaptive policy'])
    plt.draw()
    plt.close('all')
Ejemplo n.º 2
0
def test_pairs_scatter():
    results = load_results(r'..\data\eng_trans_100.cPickle', zipped=False)    
    
    pairs_scatter(results)
#    set_fig_to_bw(pairs_scatter(results)[0])
    
    pairs_scatter(results, group_by='policy',
                  grouping_specifiers='basic policy', legend=False)
#    set_fig_to_bw(pairs_scatter(results, group_by='policy')[0])
    
    pairs_scatter(results, group_by='policy', 
                  grouping_specifiers=['no policy', 'adaptive policy'])
#    set_fig_to_bw(pairs_scatter(results, group_by='policy', legend=False)[0])
    plt.show()
Ejemplo n.º 3
0
def test_pairs_scatter():
    results = util.load_eng_trans_data() 
    
    pairs_scatter(results)
#    set_fig_to_bw(pairs_scatter(results)[0])
    
    pairs_scatter(results, group_by='policy',
                  grouping_specifiers='basic policy', legend=False)
#    set_fig_to_bw(pairs_scatter(results, group_by='policy')[0])
    
    pairs_scatter(results, group_by='policy', 
                  grouping_specifiers=['no policy', 'adaptive policy'])
#    set_fig_to_bw(pairs_scatter(results, group_by='policy', legend=False)[0])
    plt.show()
def test_pairs_scatter():
    results = test_utilities.load_eng_trans_data()

    pairs_scatter(results)

    pairs_scatter(results,
                  group_by='policy',
                  grouping_specifiers='basic policy',
                  legend=False)

    pairs_scatter(results,
                  group_by='policy',
                  grouping_specifiers=['no policy', 'adaptive policy'])
    plt.draw()
    plt.close('all')
Ejemplo n.º 5
0
from expWorkbench.util import load_results
from expWorkbench import ema_logging

ema_logging.log_to_stderr(level=ema_logging.DEFAULT_LEVEL)

#load the data
experiments, outcomes = load_results(r'.\data\100 flu cases no policy.bz2')

#transform the results to the required format
tr = {}

#get time and remove it from the dict
time = outcomes.pop('TIME')

for key, value in outcomes.items():
    if key == 'deceased population region 1':
        tr[key] = value[:,-1] #we want the end value
    else:
        # we want the maximum value of the peak
        tr['max peak'] = np.max(value, axis=1) 
        
        # we want the time at which the maximum occurred
        # the code here is a bit obscure, I don't know why the transpose 
        # of value is needed. This however does produce the appropriate results
        logicalIndex = value.T==np.max(value, axis=1)
        tr['time of max'] = time[logicalIndex.T]
        
pairs_scatter((experiments, tr), filter_scalar=False)
pairs_lines((experiments, outcomes))
pairs_density((experiments, tr), filter_scalar=False)
plt.show() 
'''
Created on 26 sep. 2011

@author: jhkwakkel
'''
import matplotlib.pyplot as plt

from expWorkbench import load_results
from analysis.pairs_plotting import pairs_scatter

data = load_results(r'../../../src/analysis/1000 flu cases.cPickle', zipped=False)
fig = pairs_scatter(data, group_by='policy', legend=True)
plt.show()
Ejemplo n.º 7
0
from expWorkbench.util import load_results
from expWorkbench import ema_logging

ema_logging.log_to_stderr(level=ema_logging.DEFAULT_LEVEL)

#load the data
experiments, outcomes = load_results(r'.\data\100 flu cases no policy.bz2')

#transform the results to the required format
newResults = {}

#get time and remove it from the dict
time = outcomes.pop('TIME')

for key, value in outcomes.items():
    if key == 'deceased population region 1':
        newResults[key] = value[:,-1] #we want the end value
    else:
        # we want the maximum value of the peak
        newResults['max peak'] = np.max(value, axis=1) 
        
        # we want the time at which the maximum occurred
        # the code here is a bit obscure, I don't know why the transpose 
        # of value is needed. This however does produce the appropriate results
        logicalIndex = value.T==np.max(value, axis=1)
        newResults['time of max'] = time[logicalIndex.T]
        
pairs_scatter((experiments, newResults))
pairs_lines((experiments, newResults))
pairs_density((experiments, newResults))
plt.show() 
Ejemplo n.º 8
0
# load the data
fh = r'.\data\1000 flu cases no policy.tar.gz'
experiments, outcomes = load_results(fh)

# transform the results to the required format
# that is, we want to know the max peak and the casualties at the end of the
# run
tr = {}

# get time and remove it from the dict
time = outcomes.pop('TIME')

for key, value in outcomes.items():
    if key == 'deceased population region 1':
        tr[key] = value[:, -1]  #we want the end value
    else:
        # we want the maximum value of the peak
        max_peak = np.max(value, axis=1)
        tr['max peak'] = max_peak

        # we want the time at which the maximum occurred
        # the code here is a bit obscure, I don't know why the transpose
        # of value is needed. This however does produce the appropriate results
        logical = value.T == np.max(value, axis=1)
        tr['time of max'] = time[logical.T]

pairs_scatter((experiments, tr), filter_scalar=False)
pairs_lines((experiments, outcomes))
pairs_density((experiments, tr), filter_scalar=False)
plt.show()
Ejemplo n.º 9
0
'''
Created on 26 sep. 2011

@author: jhkwakkel
'''
import matplotlib.pyplot as plt

from expWorkbench import load_results
from analysis.pairs_plotting import pairs_scatter

data = load_results(r'../../../src/analysis/1000 flu cases.cPickle',
                    zipped=False)
fig = pairs_scatter(data, group_by='policy', legend=True)
plt.show()