Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chap2 'super' object has no attribute '__sklearn_tags__' X_train = kag_pl.fit_transform(kag_X_train, kag_y_train) #23

Open
pragatech opened this issue Jan 8, 2025 · 0 comments

Comments

@pragatech
Copy link

X_train = kag_pl.fit_transform(kag_X_train, kag_y_train)

while executing above line, I am getting below error

:22: FutureWarning: Downcasting behavior in replace is deprecated and will be removed in a future version. To retain the old behavior, explicitly call result.infer_objects(copy=False). To opt-in to the future behavior, set pd.set_option('future.no_silent_downcasting', True)
education=df_.Q4.replace({'Master’s degree': 18,
:51: FutureWarning: Downcasting behavior in replace is deprecated and will be removed in a future version. To retain the old behavior, explicitly call result.infer_objects(copy=False). To opt-in to the future behavior, set pd.set_option('future.no_silent_downcasting', True)
python=df_.Q16_Part_1.fillna(0).replace('Python', 1),
:52: FutureWarning: Downcasting behavior in replace is deprecated and will be removed in a future version. To retain the old behavior, explicitly call result.infer_objects(copy=False). To opt-in to the future behavior, set pd.set_option('future.no_silent_downcasting', True)
r=df_.Q16_Part_2.fillna(0).replace('R', 1),
:53: FutureWarning: Downcasting behavior in replace is deprecated and will be removed in a future version. To retain the old behavior, explicitly call result.infer_objects(copy=False). To opt-in to the future behavior, set pd.set_option('future.no_silent_downcasting', True)
sql=df_.Q16_Part_3.fillna(0).replace('SQL', 1)
/usr/local/lib/python3.10/dist-packages/sklearn/utils/_tags.py:354: FutureWarning: The OneHotEncoder or classes from which it inherits use _get_tags and _more_tags. Please define the __sklearn_tags__ method, or inherit from sklearn.base.BaseEstimator and/or other appropriate mixins such as sklearn.base.TransformerMixin, sklearn.base.ClassifierMixin, sklearn.base.RegressorMixin, and sklearn.base.OutlierMixin. From scikit-learn 1.7, not defining __sklearn_tags__ will raise an error.
warnings.warn(

AttributeError Traceback (most recent call last)
in <cell line: 1>()
----> 1 X_train = kag_pl.fit_transform(kag_X_train, kag_y_train)

12 frames
/usr/local/lib/python3.10/dist-packages/sklearn/base.py in sklearn_tags(self)
857
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'

@pragatech pragatech changed the title Chap2 'super' object has no attribute '__sklearn_tags__' Chap2 'super' object has no attribute '__sklearn_tags__' X_train = kag_pl.fit_transform(kag_X_train, kag_y_train) Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant