91de05779be2545c6c95b2ed4658e7ab4d607ad5,tests/functional/test_inference.py,,test_rejection,#,8

Before Change


    res = rej.sample(N, quantile=.01)
    samples = list(res.samples.values())

    assert isinstance(samples, list)
    assert len(samples[0]) == N
    // Set somewhat loose intervals for now
    e = 0.1
    assert np.abs(np.mean(samples[0]) - t1_0) < e

After Change




def test_rejection():
    true_params = OrderedDict(t1=.6, t2=.2)
    n_obs = 500
    N = 1000
    m = ma2.get_model(n_obs=n_obs, true_params=true_params.values())

    rej = elfi.Rejection(m.get_reference("d"), seed=23022017, batch_size=10000)
    res = rej.sample(N, quantile=.01)

    outputs = res["outputs"]
    t1 = outputs["t1"]
    t2 = outputs["t2"]

    assert len(t1) == N
    // Set somewhat loose intervals for now
    e = 0.1
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: elfi-dev/elfi
Commit Name: 91de05779be2545c6c95b2ed4658e7ab4d607ad5
Time: 2017-02-23
Author: jarno.lintusaari@aalto.fi
File Name: tests/functional/test_inference.py
Class Name:
Method Name: test_rejection


Project Name: ilastik/ilastik
Commit Name: da09a6e992ff6dad66b81ef01e1a209867edcf6b
Time: 2014-04-28
Author: bergs@janelia.hhmi.org
File Name: lazyflow/operators/opResize.py
Class Name: OpResize
Method Name: setupOutputs


Project Name: Scitator/catalyst
Commit Name: 82d414fb55933e83554ad62ab27b164d905860e8
Time: 2018-12-11
Author: scitator@gmail.com
File Name: dl/runner.py
Class Name: AbstractModelRunner
Method Name: prepare_callbacks


Project Name: ilastik/ilastik
Commit Name: 558f030de16f0e3ea4ce860aac0d085faad99441
Time: 2019-08-13
Author: k-dominik@users.noreply.github.com
File Name: ilastik/applets/batchProcessing/batchProcessingGui.py
Class Name: BatchProcessingGui
Method Name: run_export