DOC Adds example for preprocessing.FunctionTransformer
@@ -69,6 +69,15 @@ class FunctionTransformer(TransformerMixin, BaseEstimator):
inv_kw_args : dict, optional
Dictionary of additional keyword arguments to pass to inverse_func.
+ Examples
+ --------
+ >>> import numpy as np
+ >>> from sklearn.preprocessing import FunctionTransformer
+ >>> transformer = FunctionTransformer(np.log1p)
+ >>> X = np.array([[0, 1], [2, 3]])
+ >>> transformer.transform(X)
+ array([[0. , 0.6931...],
+ [1.0986..., 1.3862...]])
"""
def __init__(self, func=None, inverse_func=None, validate=False,
accept_sparse=False, check_inverse=True, kw_args=None,
