# modAL.density¶

Measures for estimating the information density of a given sample.

modAL.density.information_density(X: Union[list, numpy.ndarray, scipy.sparse.csr.csr_matrix], metric: Union[str, Callable] = 'euclidean') → numpy.ndarray[source]

Calculates the information density metric of the given data using the given metric.

Parameters: X – The data for which the information density is to be calculated. metric – The metric to be used. Should take two 1d numpy.ndarrays for argument.
Returns: The information density for each sample.
modAL.density.similarize_distance(distance_measure: Callable) → Callable[source]

Takes a distance measure and converts it into a information_density measure.

Parameters: distance_measure – The distance measure to be converted into information_density measure. The information_density measure obtained from the given distance measure.