Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(5)  |  Call(4)  |  Derive(0)  |  Import(1)

src/a/s/astatsa-1.0.1/src/astatsa/expectation_weighted/expectation_weighted_test.py   astatsa(Download)
from astatsa.expectation_weighted.expectation_weighted import ExpectationWeighted
 
import numpy as np
from astatsa.utils.np_comparisons import assert_allclose
 
def test_weighted_1():
    ex = ExpectationWeighted()
def test_weighted_2():
    ex = ExpectationWeighted()
    ex.update(np.array([1, 1]), np.array([0, 0]))
    ex.update(np.array([1, 2]), np.array([0, 0]))
    assert_allclose(42, ex.get_value(42))
 
def test_weighted_3():
    ex = ExpectationWeighted()
def test_weighted_4():
    ex = ExpectationWeighted()
    ex.update(np.array([1, 1]), np.array([0, 101]))
    ex.update(np.array([2, 2]), np.array([23, 0]))
    assert_allclose([2, 1], ex.get_value())