Skip to content

Commit

Permalink
Merge pull request #769 from a-szulc/master
Browse files Browse the repository at this point in the history
add catch for autoML warning and a check for pandas future warning (fixes #754)
  • Loading branch information
pplonski authored Sep 2, 2024
2 parents 3f65896 + fceff2b commit 2b6aa16
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions supervised/preprocessing/scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def inverse_transform(self, X):
if self.scale_method == self.SCALE_NORMAL:
X.loc[:, self.columns] = self.scale.inverse_transform(X[self.columns])
elif self.scale_method == self.SCALE_LOG_AND_NORMAL:
X[self.columns] = X[self.columns].astype("float64")

X[self.columns] = self.scale.inverse_transform(X[self.columns])
X[self.columns] = np.exp(X[self.columns])

Expand Down
9 changes: 8 additions & 1 deletion tests/tests_automl/test_targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,14 @@ def test_regression_missing_target(self):
explain_level=0,
start_random_models=1,
)
automl.fit(X, y)

with pytest.warns(
match="There are samples with missing target values in the data which will be excluded for further analysis"
) as record:
automl.fit(X, y)

self.assertEqual(len(record), 1)

pred = automl.predict(X)

self.assertIsInstance(pred, np.ndarray)
Expand Down

0 comments on commit 2b6aa16

Please sign in to comment.