temporalmapper.Mapper

class temporalmapper.Mapper(clusterer: ~sklearn.base.ClusterMixin, n_slices: int = 5, n_neighbors: int = 5, overlap: float = 0.5, inclusion_threshold: float = 0.1, slice_method: str = 'time', density_based: bool = True, kernel: ~collections.abc.Callable[[float, float, float, float], float] = <function square>, kernel_params: dict | None = None, lens_index: int = -1, verbose: int = 0)

sklearn compliant density-based Mapper estimator.

fit():

Run the density-based mapper algorithm to construct a Mapper graph.

__init__(clusterer: ~sklearn.base.ClusterMixin, n_slices: int = 5, n_neighbors: int = 5, overlap: float = 0.5, inclusion_threshold: float = 0.1, slice_method: str = 'time', density_based: bool = True, kernel: ~collections.abc.Callable[[float, float, float, float], float] = <function square>, kernel_params: dict | None = None, lens_index: int = -1, verbose: int = 0)
Parameters:
  • clusterer (sklearn ClusterMixin) – The clusterer to use for the slice-wise clustering.

  • n_slices (int) – number of time-points at which to cluster

  • n_neighbors (int (optional, default=5)) – The number of nearest neighbors used in the density computation.

  • overlap (float (optional, default=0.5)) – A float in (0,1) which specifies the g parameter (see README)

  • inclusion_threshold (float (optional, default=0.1)) – A float in [0,1) which specifies the minimum kernel weight for a point to be included in a slice.

  • slice_method (str (optional, default='time')) – One of ‘time’ or ‘data’. If time, generates n_checkpoints evenly spaced in time. If data, generates n_checkpoints such that there are equal amounts of data between the points.

  • density_based (bool (optional, default=True)) – Whether to use density-based Mapper. If False, skips the density computation and uses a standard pullback Mapper cover.

  • kernel (function (optional, default=temporalmapper.kernels.square)) – A function with signature f(t0, t, density, binwidth, epsilon=0.01, params=None). Options are included in temporalmapper.kernels, default is temporalmapper.kernels.square.

  • kernel_params (tuple or None,) – Passed to kernel as params kwarg.

  • lens_index (int (optional, default=-1)) – The index of expected input data to use as the lens-space function.

  • verbose (bool) – Does what you expect.

Methods

__init__(clusterer, n_slices, n_neighbors, ...)

fit(X[, y, drop_time])

get_metadata_routing()

Get metadata routing of this object.

get_params([deep])

Get parameters for this estimator.

set_fit_request(*[, drop_time])

Configure whether metadata should be requested to be passed to the fit method.

set_params(**params)

Set the parameters of this estimator.