aws / amazon-sagemaker-clarify

Fairness Aware Machine Learning. Bias detection and mitigation for datasets and models.
Apache License 2.0
66 stars 38 forks source link

Fix bug: TypeError when calculating abs value of "CONTINUOUS" data #110

Closed xgchena closed 3 years ago

xgchena commented 3 years ago

Issue #, if available:

https://tiny.amazon.com/r0677v90

Description of changes:

_interval_index() may raise "TypeError: bad operand type for abs(): 'str'" and the rootcause is that series_datatype() determined a string series as CONTINUOUS, but didn't convert the data to numeric.

The commit ensures consistency of the deduced DataType and the dtype of a data series.

Major changes:

Testing Done:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.