Skip to content

AttributeError: 'super' object has no attribute '__sklearn_tags__' #122

@sshu2017

Description

@sshu2017

I was following the "The Basics" tutorial but got an error like below when I ran this cell:

from skorecard.bucketers import DecisionTreeBucketer

bucketer = DecisionTreeBucketer(max_n_bins=10)
X_transformed = bucketer.fit_transform(X, y)

Also reproduced on my MacBook.


AttributeError Traceback (most recent call last)
Cell In[7], line 1
----> 1 X_transformed = bucketer.fit_transform(X, y)

File ~/Documents/PYTHON/06_enSkoreCard/skorecard/.myskorecard/lib/python3.10/site-packages/sklearn/utils/_set_output.py:319, in _wrap_method_output..wrapped(self, X, *args, **kwargs)
317 @wraps(f)
318 def wrapped(self, X, *args, **kwargs):
--> 319 data_to_wrap = f(self, X, *args, **kwargs)
320 if isinstance(data_to_wrap, tuple):
321 # only wrap the first output for cross decomposition
322 return_tuple = (
323 _wrap_data_with_container(method, data_to_wrap[0], X, self),
324 *data_to_wrap[1:],
325 )

File ~/Documents/PYTHON/06_enSkoreCard/skorecard/.myskorecard/lib/python3.10/site-packages/sklearn/base.py:921, in TransformerMixin.fit_transform(self, X, y, **fit_params)
918 return self.fit(X, **fit_params).transform(X)
919 else:
920 # fit method of arity 2 (supervised transformation)
--> 921 return self.fit(X, y, **fit_params).transform(X)

File ~/Documents/PYTHON/06_enSkoreCard/skorecard/skorecard/bucketers/base_bucketer.py:275, in BaseBucketer.fit(self, X, y)
272 self._update_column_fit(X, y, feature, special, splits, right)
274 if self.get_statistics:
--> 275 self._generate_summary(X, y)
277 return self

File ~/Documents/PYTHON/06_enSkoreCard/skorecard/skorecard/reporting/report.py:223, in SummaryMethod.generate_summary(self, X, y)
221 check_is_fitted(self.steps[-1][1])
222 else:
--> 223 check_is_fitted(self)
225 self.summary_dict
= {}
227 # Calculate information value

File ~/Documents/PYTHON/06_enSkoreCard/skorecard/.myskorecard/lib/python3.10/site-packages/sklearn/utils/validation.py:1751, in check_is_fitted(estimator, attributes, msg, all_or_any)
1748 if not hasattr(estimator, "fit"):
1749 raise TypeError("%s is not an estimator instance." % (estimator))
-> 1751 tags = get_tags(estimator)
1753 if not tags.requires_fit and attributes is None:
1754 return

File ~/Documents/PYTHON/06_enSkoreCard/skorecard/.myskorecard/lib/python3.10/site-packages/sklearn/utils/_tags.py:430, in get_tags(estimator)
428 for klass in reversed(type(estimator).mro()):
429 if "sklearn_tags" in vars(klass):
--> 430 sklearn_tags_provider[klass] = klass.sklearn_tags(estimator) # type: ignore[attr-defined]
431 class_order.append(klass)
432 elif "_more_tags" in vars(klass):

File ~/Documents/PYTHON/06_enSkoreCard/skorecard/.myskorecard/lib/python3.10/site-packages/sklearn/base.py:859, in TransformerMixin.sklearn_tags(self)
858 def sklearn_tags(self):
--> 859 tags = super().sklearn_tags()
860 tags.transformer_tags = TransformerTags()
861 return tags

AttributeError: 'super' object has no attribute 'sklearn_tags'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions