k_center.landmarks

k_center.landmarks(X, k=15, eps=-1.0, seed=0, full_output=False, metric='euclidean')

Computes landmarks points for a point set or set of distance using the ‘maxmin’ method.

This function computes a prefix of the greedy permutation of X using the ‘maxmin’ method; if k is set, only the first k points are found, otherwise if eps is positive the prefix is expanded until a cover over X of balls with radius eps is found.

Parameters

Name Type Description Default
X ArrayLike (n x d) matrix of n points in d dimensions, a distance matrix, or a set of pairwise distances required
k Optional[int] number of landmarks requested. Defaults to 15. 15
eps Optional[float] covering radius to stop finding landmarks at. If negative, uses k instead (default). -1.0
seed int index of the initial point to be the first landmark. Defaults to 0. 0
full_output bool whether to return insertion radii and predecessors. Defaults to False. False
metric str metric distance to use. Ignored if X is a set of distances. See details. 'euclidean'

Returns

Type Description
np.ndarray Indices of the landmark points; if full_output = True, also returns a dictionary containing auxiliary information.

Notes

  • The first radius is always the diameter of the point set, which can be expensive to compute for high dimensions, so by default “inf” is used as the first covering radius
  • If metric = "euclidean" and X is a set of coordinates, the landmarks may be computed from the point set directly. For all other metrics, you must compute all pairwise distances first and supply that as X.
  • If ‘k’ is specified an ‘eps’ is not (or it’s -1.0), then the procedure stops when ‘k’ landmarks are found. The converse is true if k = 0 and eps > 0. If both are specified, the both are used as stopping criteria for the procedure (whichever becomes true first).
  • dictionary containing the insertion radii whose values ‘r’ yield a cover of ‘a’ when balls of radius ‘r’ are places at the landmark points and the predecessors.