gudhi.point_cloud.dtm.DTMDensity Class Reference

Public Member Functions

def __init__ (self, k=None, weights=None, q=None, dim=None, normalize=False, n_samples=None, **kwargs)
 
def fit (self, X, y=None)
 
def transform (self, X)
 

Detailed Description

Density estimator based on the distance to the empirical measure defined by a point set, as defined
in :cite:`dtmdensity`. Note that this implementation only renormalizes when asked, and the renormalization
only works for a Euclidean metric, so in other cases the total measure may not be 1.

.. note:: When the dimension is high, using it as an exponent can quickly lead to under- or overflows.
    We recommend using a small fixed value instead in those cases, even if it won't have the same nice
    theoretical properties as the dimension.

Constructor & Destructor Documentation

◆ __init__()

def gudhi.point_cloud.dtm.DTMDensity.__init__ (   self,
  k = None,
  weights = None,
  q = None,
  dim = None,
  normalize = False,
  n_samples = None,
**  kwargs 
)
Args:
    k (int): number of neighbors (possibly including the point itself). Optional if it can be guessed
from weights or metric="neighbors".
    weights (numpy.array): weights of each of the k neighbors, optional. They are supposed to sum to 1.
    q (float): order used to compute the distance to measure. Defaults to dim.
    dim (float): final exponent representing the dimension. Defaults to the dimension, and must be specified
when the dimension cannot be read from the input (metric is "neighbors" or "precomputed").
    normalize (bool): normalize the density so it corresponds to a probability measure on ℝᵈ.
Only available for the Euclidean metric, defaults to False.
    n_samples (int): number of sample points used for fitting. Only needed if `normalize` is True and
metric is "neighbors".
    kwargs: same parameters as :class:`~gudhi.point_cloud.knn.KNearestNeighbors`, except that
metric="neighbors" means that :func:`transform` expects an array with the distances to
the k nearest neighbors.

Member Function Documentation

◆ fit()

def gudhi.point_cloud.dtm.DTMDensity.fit (   self,
  X,
  y = None 
)
Args:
    X (numpy.array): coordinates for mass points.

◆ transform()

def gudhi.point_cloud.dtm.DTMDensity.transform (   self,
  X 
)
Args:
    X (numpy.array): coordinates for query points, or distance matrix if metric is "precomputed",
or distances to the k nearest neighbors if metric is "neighbors" (if the array has more
than k columns, the remaining ones are ignored).

The documentation for this class was generated from the following file:
GUDHI  Version 3.3.0  - C++ library for Topological Data Analysis (TDA) and Higher Dimensional Geometry Understanding.  - Copyright : MIT Generated on Tue Aug 11 2020 11:58:59 for GUDHI by Doxygen 1.8.18