Skip to main content

Module density

Module density 

Source
Expand description

Information density — weight raw uncertainty by how representative a point is, so the query strategy is not lured into labelling unrepresentative outliers (which are uncertain but teach the model little about the bulk of the data).

density_i = uncertainty_i · ( mean_j similarity(i, j) )^β. With β = 0 this reduces to plain uncertainty; larger β favours points in dense regions.

Functions§

cosine_similarity
Cosine similarity of two equal-length feature vectors, in [-1, 1]. Zero vectors have undefined direction → similarity 0.
information_density
Information-density scores: uncertainty_i · representativeness_i^β. Lengths of uncertainty and features must match. Representativeness is clamped to ≥ 0 before exponentiation (negative mean-similarity points get no density bonus).
rank_by_density
Rank pool indices by information density, most-informative first.
representativeness
Mean representativeness of each point: the average similarity of point i to all other points in the pool. features is n_samples × n_features.