import numpy as np from mapper import Mapper with open('point_clouds/cup.txt') as f: data = f.readlines() points = np.array([list(map(float, p.strip().split(' '))) for p in data]) mapper = Mapper(bins=10, overlap=0.1, coordinate=0) graph = mapper.fit(points) mapper.plot_vertices() mapper.plot_intervals() mapper.plot_clusters() mapper.plot_graph() mapper.plot_graph_in_plane(seed=22) mapper.plot_persistence_homology()
import numpy as np from mapper import Mapper with open('point_clouds/hand.txt') as f: data = f.readlines() points = np.array([list(map(float, p.strip().split(' '))) for p in data]) mapper = Mapper(coordinate=1) graph = mapper.fit(points) mapper.plot_vertices() mapper.plot_intervals() mapper.plot_clusters() mapper.plot_graph() mapper.plot_graph_in_plane() mapper.plot_persistence_homology()
import numpy as np from mapper import Mapper points = np.load('point_clouds/lion.npy') mapper = Mapper(bins=7, overlap=0.1, filter_function='distance_from_point') graph = mapper.fit(points) mapper.plot_vertices() mapper.plot_intervals() mapper.plot_clusters() mapper.plot_graph() mapper.plot_graph_in_plane() # Disconnected tail. mapper.plot_persistence_homology()