docstr: 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.
docstr_tok: ["Sklearn","BaseEnsemble","models","contain","other","models","as","parameter",";","those","ca","n'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","."]
code: def _delete_base_estimator_from_dict(self, params):
      """
      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.
      """
      for name in list(params.keys()):
          if isinstance(params[name], BaseEstimator):
              del params[name]
  
imports: import functools
  import inspect
  from typing import Any, Tuple
  from neuraxle.base import BaseStep
  from neuraxle.base import ExecutionContext
  from neuraxle.hyperparams.distributions import Boolean, LogUniform
  from neuraxle.hyperparams.space import HyperparameterSamples, HyperparameterSpace, RecursiveDict
  from neuraxle.steps.numpy import NumpyTranspose
  from neuraxle.union import ModelStacking
  from sklearn.base import BaseEstimator
  from sklearn.ensemble import BaseEnsemble
  from sklearn.linear_model import Ridge
label_desc: Use image node_id 3 for calling the SKLearnWrapper obj's underlying member method code with example usage: obj._delete_base_estimator_from_dict(params) without return types