Exemplo n.º 1
0
    def test_wrong_id(self):
        mapper = KeplerMapper(verbose=1)
        data = np.random.rand(100, 2)

        graph = mapper.map(data)
        mems = mapper.data_from_cluster_id("new node", graph, data)
        np.testing.assert_array_equal(mems, np.array([]))
Exemplo n.º 2
0
    def test_members_from_id(self):
        mapper = KeplerMapper(verbose=1)
        data = np.random.rand(100, 2)

        ids = np.random.choice(10, 100)
        data[ids] = 2

        graph = mapper.map(data)
        graph["nodes"]["new node"] = ids
        mems = mapper.data_from_cluster_id("new node", graph, data)
        np.testing.assert_array_equal(data[ids], mems)