Skip to content

Commit

Permalink
refactor(core): simplify, as steps can't be nested
Browse files Browse the repository at this point in the history
  • Loading branch information
deepyaman committed Sep 14, 2024
1 parent b10dcb0 commit 1c8706e
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions ibis_ml/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import ibis
import ibis.expr.operations as ops
import ibis.expr.types as ir
from ibis.common.deferred import Deferred
from ibis.common.dispatch import lazy_singledispatch

if TYPE_CHECKING:
Expand Down Expand Up @@ -354,8 +353,7 @@ def get_params(self, deep=True) -> dict[str, Any]:
Parameters
----------
deep : bool, default=True
If True, will return the parameters for this estimator and
contained subobjects that are estimators.
Has no effect, because steps cannot contain nested substeps.
Returns
-------
Expand All @@ -370,19 +368,7 @@ def get_params(self, deep=True) -> dict[str, Any]:
----------
.. [1] https://github.com/scikit-learn/scikit-learn/blob/626b460/sklearn/base.py#L145-L167
"""
out = {}
for key in self._get_param_names():
value = getattr(self, key)
if (
deep
and hasattr(value, "get_params")
# `hasattr()` always returns `True` for deferred objects
and not isinstance(value, (type, Deferred))
):
deep_items = value.get_params().items()
out.update((key + "__" + k, val) for k, val in deep_items)
out[key] = value
return out
return {key: getattr(self, key) for key in self._get_param_names()}

def __repr__(self) -> str:
return pprint.pformat(self)
Expand Down Expand Up @@ -527,8 +513,6 @@ def set_output(
) -> Recipe:
"""Set output type returned by `transform`.
This is part of the standard Scikit-Learn API.
Parameters
----------
transform : {"default", "pandas"}, default=None
Expand Down

0 comments on commit 1c8706e

Please sign in to comment.