Giskard-AI/giskard-examples

GSK-325/A check to warn the user of implementing a categorical feature as numeric one

Closed this issue · 1 comments

Based on the following comment: #1 (comment)

Possible solution:
One way I could think of is to implement a warning check using df.nunique(), which gives the following output for this notebook for example:

gender                 2
SeniorCitizen          2
Partner                2
Dependents             2
tenure                72
PhoneService           2
MultipleLines          3
InternetService        3
OnlineSecurity         3
OnlineBackup           3
DeviceProtection       3
TechSupport            3
StreamingTV            3
StreamingMovies        3
Contract               3
PaperlessBilling       2
PaymentMethod          4
MonthlyCharges      1584
TotalCharges        6530
Churn                  2

then, we compare these to the column_types given by the user, in case the user puts numeric for a unique count of <10 for instance, we issue a warning.

The merge of Giskard-AI/giskard-client#45 solves this issue.