1 from ._CustomTransformer
import _CustomTransformer
7 ''' tanh-estimator (Hampel et al. 1986; Latha & Thangasamy, 2011) '''
10 def _fit(self, X, *args, **kwargs):
14 a = np.percentile(d, 70, 0)
15 b = np.percentile(d, 85, 0)
16 c = np.percentile(d, 95, 0)
20 phi = np.zeros(X.shape)
21 idx = np.logical_and(0 <= Xab, Xab < a)
23 idx = np.logical_and(a <= Xab, Xab < b)
24 phi[idx] = (a * Xsi)[idx]
25 idx = np.logical_and(b <= Xab, Xab < c)
26 phi[idx] = (a * Xsi * ((c - Xab) / (c - b)))[idx]
31 def _transform(self, X, *args, **kwargs):
34 def _inverse_transform(self, X, *args, **kwargs):