Skip to content

Issue handling sensitive correlations #181

Description

@nagrawal2-sc

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When trying to use the function sensitive.find_sensitive_correlations where one of the columns being tested is a string, it would still still try to calculate pearson correlation and returns an error.

Expected Behavior

To calculate spearman or kendall correlation.

Steps To Reproduce

import pandas as pd
import fairlens as fl
col_names = ["gender", "nationality", "random", "corr1", "corr2"]
data = [
    ["woman", "spanish", 715, "w", 20],
    ["man", "spanish", 1008, "m", 20],
    ["man", "french", 932, "m", 10],
    ["woman", "french", 1300, "w", 10],
       ] 
df = pd.DataFrame(data, columns=col_names)    
fl.sensitive.find_sensitive_correlations(df)

Environment

- OS:
- python: 3.9

Anything else? Screenshots?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions