From 5e8c76112fb00b5739aaa3125618c83d810ccce7 Mon Sep 17 00:00:00 2001 From: Deepyaman Datta Date: Fri, 13 Sep 2024 17:39:49 -0600 Subject: [PATCH] refactor(core): simplify, as steps can't be nested --- ibis_ml/core.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/ibis_ml/core.py b/ibis_ml/core.py index 7f115c6..4515ed5 100644 --- a/ibis_ml/core.py +++ b/ibis_ml/core.py @@ -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: @@ -370,19 +369,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)