How to use the kmapper.to_networkx function in kmapper

To help you get started, we’ve selected a few kmapper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github scikit-tda / kepler-mapper / test / test_drawing.py View on Github external
def test_nx_input(self, mapper):
        draw_matplotlib(km.to_networkx(mapper))
github scikit-tda / kepler-mapper / test / test_adapters.py View on Github external
def test_convertions(self):
        mapper = KeplerMapper(verbose=0)
        data = np.random.rand(100, 2)
        graph = mapper.map(data)

        g = to_networkx(graph)
        assert isinstance(g, nx.Graph)
github scikit-tda / kepler-mapper / test / test_adapters.py View on Github external
def test_membership(self):
        mapper = KeplerMapper(verbose=0)
        data = np.random.rand(100, 2)
        graph = mapper.map(data)
        n, m = list(graph["nodes"].items())[0]
        g = to_networkx(graph)
        assert g.nodes[n]["membership"] == m