Flow
sklearn.preprocessing._function_transformer.FunctionTransformer

sklearn.preprocessing._function_transformer.FunctionTransformer

Visibility: public Uploaded 02-02-2024 by Jano P sklearn==1.3.2 numpy>=1.17.3 scipy>=1.5.0 joblib>=1.1.1 threadpoolctl>=2.0.0 0 runs
0 likes downloaded by 0 people 0 issues 0 downvotes , 0 total downloads
  • openml-python python scikit-learn sklearn sklearn_1.3.2
Issue #Downvotes for this reason By


Loading wiki
Help us complete this description Edit
Constructs a transformer from an arbitrary callable. A FunctionTransformer forwards its X (and optionally y) arguments to a user-defined function or function object and returns the result of this function. This is useful for stateless transformations such as taking the log of frequencies, doing custom scaling, etc. Note: If a lambda is used as the function, then the resulting transformer will not be pickleable. .. versionadded:: 0.17

Parameters

accept_sparseIndicate that func accepts a sparse matrix as input. If validate is False, this has no effect. Otherwise, if accept_sparse is false, sparse matrix inputs will cause an exception to be raiseddefault: true
check_inverseWhether to check that or ``func`` followed by ``inverse_func`` leads to the original inputs. It can be used for a sanity check, raising a warning when the condition is not fulfilled .. versionadded:: 0.20default: true
feature_names_outDetermines the list of feature names that will be returned by the `get_feature_names_out` method. If it is 'one-to-one', then the output feature names will be equal to the input feature names. If it is a callable, then it must take two positional arguments: this `FunctionTransformer` (`self`) and an array-like of input feature names (`input_features`). It must return an array-like of output feature names. The `get_feature_names_out` method is only defined if `feature_names_out` is not None See ``get_feature_names_out`` for more details .. versionadded:: 1.1default: null
funcThe callable to use for the transformation. This will be passed the same arguments as transform, with args and kwargs forwarded If func is None, then func will be the identity functiondefault: {"oml-python:serialized_object": "function", "value": "__main__."}
inv_kw_argsDictionary of additional keyword arguments to pass to inverse_func .. versionadded:: 0.18default: null
inverse_funcThe callable to use for the inverse transformation. This will be passed the same arguments as inverse transform, with args and kwargs forwarded. If inverse_func is None, then inverse_func will be the identity functiondefault: null
kw_argsDictionary of additional keyword arguments to pass to func .. versionadded:: 0.18default: null
validateIndicate that the input X array should be checked before calling ``func``. The possibilities are: - If False, there is no input validation - If True, then X will be converted to a 2-dimensional NumPy array or sparse matrix. If the conversion is not possible an exception is raised .. versionchanged:: 0.22 The default of ``validate`` changed from True to Falsedefault: false

0
Runs

List all runs
Parameter:
Rendering chart
Rendering table