diff --git a/supervised/preprocessing/scale.py b/supervised/preprocessing/scale.py index d2b88d4d..bde673ab 100644 --- a/supervised/preprocessing/scale.py +++ b/supervised/preprocessing/scale.py @@ -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]) diff --git a/tests/tests_automl/test_targets.py b/tests/tests_automl/test_targets.py index 1a2eb8aa..ccf45dd0 100644 --- a/tests/tests_automl/test_targets.py +++ b/tests/tests_automl/test_targets.py @@ -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)