Skip to content

Commit

Permalink
Fix bug in Scaler.inverse_transform()
Browse files Browse the repository at this point in the history
  • Loading branch information
pzinemanas committed Jul 29, 2020
1 parent 736c5f6 commit 754cce3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions dcase_models/data/scaler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 754cce3

Please sign in to comment.