mirror of
https://github.com/IBM/ai-privacy-toolkit.git
synced 2026-07-02 16:01:00 +02:00
fix notebook and add features_names to ArrayDataset
and allow providing features names in QI and Cat features not just indexes
This commit is contained in:
parent
137167fb0c
commit
66c86dc595
5 changed files with 89 additions and 74 deletions
|
|
@ -44,7 +44,7 @@ def test_anonymize_pandas_adult():
|
|||
QI_indexes = [i for i, v in enumerate(features) if v in QI]
|
||||
categorical_features_indexes = [i for i, v in enumerate(features) if v in categorical_features]
|
||||
anonymizer = Anonymize(k, QI_indexes, categorical_features=categorical_features_indexes)
|
||||
anon = anonymizer.anonymize(ArrayDataset(x_train, pred))
|
||||
anon = anonymizer.anonymize(ArrayDataset(x_train, pred, features))
|
||||
|
||||
assert(anon.loc[:, QI].drop_duplicates().shape[0] < x_train.loc[:, QI].drop_duplicates().shape[0])
|
||||
assert (anon.loc[:, QI].value_counts().min() >= k)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue