tapas.attacks.distances

Distance metrics for closest-distance attacks.

Distances are callable objects that return an array of real number for pairs of datasets (either records, or datasets of same lengths). We here implement a range of simple distances, and easy methods to combine them.

Classes

DistanceMetric()

Distance metric between datasets.

HammingDistance([columns])

Hamming distance ("L_0"): counts the number of attributes that are identical between two records.

LpDistance([p, weights])

L_p distance between two datasets (typically, tabular datasets).

ScaledDistance(distance, factor)

(internal) class for __prod__.

SumOfDistances(distances)

(internal) class for __sum__.