diff options
author | Marc Glisse <marc.glisse@inria.fr> | 2020-05-18 23:54:02 +0200 |
---|---|---|
committer | Marc Glisse <marc.glisse@inria.fr> | 2020-05-18 23:54:02 +0200 |
commit | 2287b727126ffb9fc47869ac9ed6b6bd61c6605a (patch) | |
tree | a4bd39b51dd3e59cd18d6b634d007bd97a635fdd /src/python/test | |
parent | 5631b0d1d9f7cc7e033e40fb9b94c8fe473f6082 (diff) |
Infer k when we pass the distances to the nearest neighbors
Diffstat (limited to 'src/python/test')
-rwxr-xr-x | src/python/test/test_dtm.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/python/test/test_dtm.py b/src/python/test/test_dtm.py index 8ab0cc44..8d400c7e 100755 --- a/src/python/test/test_dtm.py +++ b/src/python/test/test_dtm.py @@ -82,3 +82,7 @@ def test_density(): density = DTMDensity(k=2, metric="neighbors", dim=1).fit_transform(distances) expected = numpy.array([2.0, 1.0, 0.5]) assert density == pytest.approx(expected) + distances = [[0, 1], [2, 0], [1, 3]] + density = DTMDensity(metric="neighbors", dim=1).fit_transform(distances) + expected = numpy.array([2.0, 1.0, 0.5]) + assert density == pytest.approx(expected) |