Skip to content

Commit

Permalink
Updated test_features.py
Browse files Browse the repository at this point in the history
  • Loading branch information
dmfolgado committed Jan 21, 2020
1 parent daef5d2 commit 4a54caa
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions tests/test_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,18 +190,15 @@ def test_rms():


def test_ecdf():
np.testing.assert_almost_equal(ecdf(const0), (1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0))
np.testing.assert_almost_equal(ecdf(const1), (1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0))
np.testing.assert_almost_equal(ecdf(constNeg), (1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0))
np.testing.assert_almost_equal(ecdf(constF), (1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0))
np.testing.assert_almost_equal(ecdf(const0), (0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5))
np.testing.assert_almost_equal(ecdf(const1), (0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5))
np.testing.assert_almost_equal(ecdf(constNeg), (0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5))
np.testing.assert_almost_equal(ecdf(constF), (0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5))
np.testing.assert_almost_equal(ecdf(lin), (0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5))
np.testing.assert_almost_equal(ecdf(lin0), (0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5))
np.testing.assert_almost_equal(ecdf(wave), (0.005, 0.005, 0.005, 0.005, 0.005, 0.012, 0.012, 0.012, 0.012, 0.012))
np.testing.assert_almost_equal(ecdf(offsetWave), (0.005, 0.005, 0.005, 0.005, 0.005, 0.012, 0.012, 0.012, 0.012,
0.012))
np.testing.assert_almost_equal(ecdf(noiseWave), (0.001, 0.002, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008, 0.009,
0.01))

np.testing.assert_almost_equal(ecdf(wave), (0.001, 0.002, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008, 0.009,0.01))
np.testing.assert_almost_equal(ecdf(offsetWave), (0.001, 0.002, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008, 0.009,0.01))
np.testing.assert_almost_equal(ecdf(noiseWave), (0.001, 0.002, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008, 0.009, 0.01))

def test_ecdf_percentile():
np.testing.assert_almost_equal(ecdf_percentile(const0), 0)
Expand Down Expand Up @@ -235,7 +232,7 @@ def test_ecdf_percentile_count():
np.testing.assert_almost_equal(ecdf_percentile_count(lin), (4, 16))
np.testing.assert_almost_equal(ecdf_percentile_count(lin0), (4, 16))
np.testing.assert_almost_equal(ecdf_percentile_count(wave), (200, 800))
np.testing.assert_almost_equal(ecdf_percentile_count(offsetWave), (199, 799))
np.testing.assert_almost_equal(ecdf_percentile_count(offsetWave), (200, 800))
np.testing.assert_almost_equal(ecdf_percentile_count(noiseWave), (200, 800))


Expand Down

0 comments on commit 4a54caa

Please sign in to comment.