Skip to content

Commit

Permalink
fix: inf filling
Browse files Browse the repository at this point in the history
Signed-off-by: Avik Basu <ab93@users.noreply.github.com>
  • Loading branch information
ab93 committed Nov 21, 2023
1 parent 5aa4c13 commit fb80cb6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion numalogic/udfs/trainer/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ def _is_data_sufficient(self, payload: TrainerPayload, df: pd.DataFrame) -> bool
return False
return True

# TODO: Use a custom imputer in transforms module
@staticmethod
def get_feature_arr(
raw_df: pd.DataFrame, metrics: list[str], fill_value: float = 0.0
Expand All @@ -265,7 +266,7 @@ def get_feature_arr(
if col not in raw_df.columns:
raw_df[col] = fill_value
feat_df = raw_df[metrics]
feat_df = feat_df.fillna(fill_value)
feat_df = feat_df.fillna(fill_value).replace([np.inf, -np.inf], fill_value)
return feat_df.to_numpy(dtype=np.float32)

def fetch_data(self, payload: TrainerPayload) -> pd.DataFrame:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "numalogic"
version = "0.6.1.dev3"
version = "0.6.1.dev4"
description = "Collection of operational Machine Learning models and tools."
authors = ["Numalogic Developers"]
packages = [{ include = "numalogic" }]
Expand Down

0 comments on commit fb80cb6

Please sign in to comment.