Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"""
2@file
3@brief Implements a base class which defines a pair of transforms
4applied around a predictor to modify the target as well.
5"""
6from sklearn.base import TransformerMixin, BaseEstimator
9class BaseReciprocalTransformer(BaseEstimator, TransformerMixin):
10 """
11 Base for transform which transforms the features
12 and the targets at the same time. It must also
13 return another transform which transforms the target
14 back to what it was.
15 """
17 def __init__(self):
18 BaseEstimator.__init__(self)
19 TransformerMixin.__init__(self)
21 def get_fct_inv(self):
22 """
23 Returns a trained transform which reverse the target
24 after a predictor.
25 """
26 raise NotImplementedError(
27 "This must be overwritten.") # pragma: no cover
29 def transform(self, X, y):
30 """
31 Transforms *X* and *y*.
32 Returns transformed *X* and *y*.
33 """
34 raise NotImplementedError(
35 "This must be overwritten.") # pragma: no cover