In [63]:
import tables
from plume.prediction import ZeroPredictor
from plume.error_estimation import WRMSE, sample_with_metropolis_hastings
import plume.error_estimation as eest
reload(eest)


Out[63]:
<module 'plume.error_estimation' from '/Volumes/Home/blubb/Documents/programming/uni/master/plume/plume/error_estimation.py'>

In [2]:
data = tables.open_file('../Data/test_5.0.h5')
with tables.open_file('../Data/test.0.h5') as f:
    sources = f.root.sources.read()

In [8]:
from plume.client import TaskPlumeClient
client = TaskPlumeClient()
client.connect_to('127.0.0.1', 10000)
client.init('TaskPlumeSingleSourceGaussianDispersionDefaultControls')
client.reset_seed(142612519)
client.reset()

In [6]:
from plume.recorder import load_obj
import sys
sys.path.append('../plume')
gp = load_obj(data.root.gp)

In [64]:
conf = {
    'area': [[-140, 140], [-140, 140], [-80, 0]],
    'num_uniform_samples': 1000,
    'num_source_samples': 4200,
    'mh_stride': 10,
    'proposal_std': 10
}
loc = eest.gen_probe_locations(client, conf)

In [66]:
eest.WRMSE()(ZeroPredictor(), loc, np.asarray(client.get_samples(loc)))


Out[66]:
(95.17440649073643,)

In [67]:
eest.WRMSE()(gp, loc, np.asarray(client.get_samples(loc)))


Out[67]:
(18.662631743954268,)

In [68]:
scatter(loc[:, 0], loc[:, 1])


Out[68]:
<matplotlib.collections.PathCollection at 0x11686a190>

In [ ]: