Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numerical data passed to a categorical privacy metric should raise an error #59

Open
fealho opened this issue Mar 26, 2021 · 0 comments
Labels
feature request Request for a new feature

Comments

@fealho
Copy link
Member

fealho commented Mar 26, 2021

And vice-versa. Currently if the wrong datatype is passed it will simply return nan. It should raise an error instead.

Below is code to reproduce this phenomena:

import pandas as pd
from sdmetrics.single_table.privacy import CategoricalCAP


data = pd.DataFrame({   # data containing only numerical values
    'key': [1.4, 10.12, 3.4],
    'sensitive': [10.9, 9.8, 8.8]
})

score = CategoricalCAP.compute(  # privacy metric that's supposed to only work with categorical values
    data,
    data, 
    key_fields=['key'],
    sensitive_fields=['sensitive']
)

print(score) # this will print `nan`
@fealho fealho added the internal The issue doesn't change the API or functionality label Mar 26, 2021
@csala csala changed the title Numerical data passed to a categorical privacy metric should raise and error Numerical data passed to a categorical privacy metric should raise an error Sep 6, 2021
@csala csala added new feature and removed internal The issue doesn't change the API or functionality labels Sep 6, 2021
@npatki npatki added feature request Request for a new feature and removed new feature labels Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request for a new feature
Projects
None yet
Development

No branches or pull requests

3 participants