neuraxle.steps.sklearn¶
Module-level documentation for neuraxle.steps.sklearn. Here is an inheritance diagram, including dependencies to other base modules of Neuraxle:
Pipeline Steps Based on Scikit-Learn¶
Those steps works with scikit-learn (sklearn) transformers and estimators.
Classes
|
|
|
Examples using neuraxle.steps.sklearn.RidgeModelStacking¶
Examples using neuraxle.steps.sklearn.SKLearnWrapper¶
-
class
neuraxle.steps.sklearn.SKLearnWrapper(wrapped_sklearn_predictor, hyperparams_space: neuraxle.hyperparams.space.HyperparameterSpace = None, return_all_sklearn_default_params_on_get: bool = False, use_partial_fit: bool = False, use_predict_proba: bool = False, partial_fit_kwargs: dict = None)[source]¶ Bases:
neuraxle.base.BaseStep-
__init__(wrapped_sklearn_predictor, hyperparams_space: neuraxle.hyperparams.space.HyperparameterSpace = None, return_all_sklearn_default_params_on_get: bool = False, use_partial_fit: bool = False, use_predict_proba: bool = False, partial_fit_kwargs: dict = None)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
_setup(context: neuraxle.base.ExecutionContext = None) → neuraxle.steps.sklearn.SKLearnWrapper[source]¶ Internal method to setup the step. May be used by
Pipelineto setup the pipeline progressively instead of all at once.
-
_delete_base_estimator_from_dict(params)[source]¶ Sklearn BaseEnsemble models contain other models as parameter; those can’t be json encoded. We retrieve the parameters of theses sub-models on a .get_params(deep=True) call, we simply need to delete them from the parameter dictionary to avoid errors when saving/loading hyperparameters.
-
fit_transform(data_inputs, expected_outputs=None) → Tuple[neuraxle.base.BaseStep, Any][source]¶ Fit, and transform step with the given data inputs, and expected outputs.
- Parameters
data_inputs – data inputs
expected_outputs – expected outputs to fit on
- Returns
(fitted self, tranformed data inputs)
-
fit(data_inputs, expected_outputs=None) → neuraxle.steps.sklearn.SKLearnWrapper[source]¶ Fit data inputs on the given expected outputs.
- Parameters
data_inputs – data inputs
expected_outputs – expected outputs to fit on.
- Returns
self
-
transform(data_inputs)[source]¶ Transform given data inputs.
- Parameters
data_inputs – data inputs
- Returns
transformed data inputs
-
_set_hyperparams(hyperparams: neuraxle.hyperparams.space.HyperparameterSamples) → neuraxle.base.BaseStep[source]¶ Set hyperparams for base step, and the wrapped sklearn_predictor.
- Return type
- Parameters
hyperparams (
HyperparameterSamples) –- Returns
self
-
_update_hyperparams(hyperparams: neuraxle.hyperparams.space.HyperparameterSamples) → neuraxle.base.BaseStep[source]¶ Update hyperparams for base step, and the wrapped sklearn_predictor.
- Return type
- Parameters
hyperparams (
HyperparameterSamples) –- Returns
self
-
_abc_impl= <_abc_data object>¶
-
-
class
neuraxle.steps.sklearn.RidgeModelStacking(brothers)[source]¶ Bases:
neuraxle.union.ModelStacking-
__init__(brothers)[source]¶ Perform model stacking. The steps will be merged with a FeatureUnion, and the judge will recombine the predictions. :param steps_as_tuple: the NamedStepsList of steps to process in parallel and to join. :param judge: a BaseStep that will learn to judge the best answer and who to trust out of every parallel steps. :param kwargs: Other arguments to send to
FeatureUnion.
-
_abc_impl= <_abc_data object>¶
-
