holisticai.security.metrics.l_diversity#

holisticai.security.metrics.l_diversity(df, qi, sa)[source]#

Description

Computes l-Diversity metric. L-diversity is a property of a dataset and an extension of k-anonymity that measures the diversity of sensitive values for each column in which they occur. A dataset has l-diversity if, for every set of rows with identical quasi-identifiers, there are at least l distinct values for each sensitive attribute.

Parameters

dfpandas Dataframe

input dataset

qilist or numpy array

quasi identifiers

salist or numpy array

sensitive attribute

Returns

dict[str, list]: Computed metric per sensitive attribute.