mirror of
https://git.gfz-potsdam.de/naaice/model-training.git
synced 2025-12-15 19:58:22 +01:00
add check for different scaler types
This commit is contained in:
parent
dd1bdb7fc5
commit
c7b89505c2
@ -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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user