OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
NegLogTransformer.py
Go to the documentation of this file.
1 from ._CustomTransformer import _CustomTransformer
2 
3 import numpy as np
4 
5 
7  '''
8  Log-like transformation which allows negative values (Whittaker et al. 2005)
9  http://fmwww.bc.edu/repec/bocode/t/transint.html
10  '''
11  def _transform(self, X, *args, **kwargs): return np.sign(X) * np.log(np.abs(X) + 1)
12  def _inverse_transform(self, X, *args, **kwargs): return np.sign(X) * (np.exp(np.abs(X)) - 1)
13 
int sign(double x)
Definition: proj_cproj.c:340