Skip to content

Commit

Permalink
hot-fixing transformation in push perturbation (#1849)
Browse files Browse the repository at this point in the history
hot fixing transformation in push perturbation

Co-authored-by: Rabah Abdul Khalek <rabahabdulkhalek@Rabahs-MacBook-Pro-2.local>
Co-authored-by: Hartorn <bazire@giskard.ai>
  • Loading branch information
3 people authored Mar 15, 2024
1 parent 6a0c1a3 commit 950afc3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions giskard/functions/transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def mad_transformation(
data = data.copy()
if value_added is None:
value_added = compute_mad(data[column_name])
data[column_name] = data[column_name].apply(lambda x: x + factor * value_added)
data[column_name] = data[column_name].apply(lambda x: x + factor * value_added).astype(data[column_name].dtype)
return data


Expand All @@ -214,5 +214,5 @@ def add_value(data: pd.DataFrame, column_name: str, value_added: float = 0.0) ->
Add the value_added to the column.
"""
data = data.copy()
data[column_name] = data[column_name].apply(lambda x: x + value_added)
data[column_name] = data[column_name].apply(lambda x: x + value_added).astype(data[column_name].dtype)
return data

0 comments on commit 950afc3

Please sign in to comment.