zen_mapper.mapper module

compute_nerve(nodes, dim=1, min_intersection=1)

Helper function to find edges of the overlapping clusters.

Parameters:
  • nodes – A dictionary with entries {node id}:{list of ids in node}

  • dim (int | None, default: 1) – An optional int, specifies the maximal dimension simplex. A value of None puts no bound on the dimension. dim = 0 returns only the nodes of the complex. Default: 1

  • min_intersection (int, default: 1) – How many points of intersection two covers should have to count as connected. Default: 1

Returns:

Komplex – Complete list of simplices

Return type:

Komplex

mapper(data, projection, cover_scheme, clusterer, dim, min_intersection=1)

Construct a simplicial complex representation of the data.

Parameters:
  • data (TypeVar(H)) – The high dimensional dataset

  • projection (ndarray) – The output of the lens/filter function on the data. Must have the same number of elements as data.

  • cover_scheme (CoverScheme) – For cover generation. Should be a callable object that takes a numpy array and returns a list of list(indices).

  • clusterer (Clusterer[TypeVar(H), TypeVar(M)]) – A callable object that takes in a dataset and returns an iterator of numpy arrays which contain indices for clustered points.

  • dim (int | None) – The highest dimension of the mapper complex to compute.

  • min_intersection (int, default: 1) – The minimum intersection required between clusters to make a simplex.

Returns:

MapperResult[TypeVar(M)] – The computational results of running mapper. A list of cluster, a simplicial complex of those clusters, and a list of cover element membership.

Return type:

MapperResult[M]