diff --git a/src/preprocessing.py b/src/preprocessing.py index be783d6..d7ecd3e 100644 --- a/src/preprocessing.py +++ b/src/preprocessing.py @@ -149,6 +149,11 @@ def custom_loss( # as far as I know tensorflow does not directly support the use of scaler objects # therefore, the backtransformation is done manually + + if preprocess.scaler_type != scaler_type: + raise Exception( + "Data normalized with scaler different than specified for the training. Compare the scaling approach on preprocessing and training.") + try: if scaler_type == "minmax": scale_X = tf.convert_to_tensor( @@ -566,6 +571,7 @@ class preprocessing: return design_resampled, target_resampled def scale_fit(self, X, y, scaling, type="Standard"): + self.scaler_type = type """Fit a scaler for data preprocessing. Args: