From 754cce36d3ad607052b67b7e248f9340dda8b0ec Mon Sep 17 00:00:00 2001 From: Pablo Zinemanas Date: Wed, 29 Jul 2020 15:59:06 +0200 Subject: [PATCH] Fix bug in Scaler.inverse_transform() --- dcase_models/data/scaler.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dcase_models/data/scaler.py b/dcase_models/data/scaler.py index b2c2249..588609d 100644 --- a/dcase_models/data/scaler.py +++ b/dcase_models/data/scaler.py @@ -189,9 +189,11 @@ def inverse_transform(self, X): of the input. """ - if self.normalizer == 'minmax': - X = (self.scaler[1]-self.scaler[0]) * \ - (X/2. + 0.5) + self.scaler[0] - if self.normalizer == 'standard': + # TODO: How the list self.normalizer should work here. + scaler_ix = 0 + if self.normalizer[scaler_ix] == 'minmax': + X = (self.scaler[scaler_ix][1]-self.scaler[scaler_ix][0]) * \ + (X/2. + 0.5) + self.scaler[scaler_ix][0] + if self.normalizer[scaler_ix][0] == 'standard': X = self.scaler.inverse_transform(X) return X