hi
- User
hi
- Assistant
Hello! How can I assist you today?
- User
in this code: stacking_clf = StackingClassifier(estimators=[('xgb', clf_xgb), ('rf', clf_rf)], final_estimator=clf_lr) stacking_clf.fit(X_train1_scaled, y_train1) y_pred_stack = stacking_clf.predict(X_test1_scaled) print('StackingClassifier Metrics (Exp1):') print(f'Accuracy: {accuracy_score(y_test1, y_pred_stack)}') print(f'Precision: {precision_score(y_test1, y_pred_stack)}') print(f'Recall: {recall_score(y_test1, y_pred_stack)}') print(f'F1 Score: {f1_score(y_test1, y_pred_stack)}') i get the error:
AttributeError Traceback (most recent call last) in <cell line: 2>() 1 stacking_clf = StackingClassifier(estimators=[('xgb', clf_xgb), ('rf', clf_rf)], final_estimator=clf_lr) ----> 2 stacking_clf.fit(X_train1_scaled, y_train1) 3 y_pred_stack = stacking_clf.predict(X_test1_scaled) 4 print('StackingClassifier Metrics (Exp1):') 5 print(f'Accuracy: {accuracy_score(y_test1, y_pred_stack)}')
12 frames /usr/local/lib/python3.10/dist-packages/sklearn/base.py in sklearn_tags(self) 538 539 def sklearn_tags(self): --> 540 tags = super().sklearn_tags() 541 tags.estimator_type = "classifier" 542 tags.classifier_tags = ClassifierTags()
AttributeError: 'super' object has no attribute ''
- Assistant
The error you're encountering,
AttributeError: 'super' object has no attribute '__sklearn_tags__', typically arises when one of the classifiers being used in your stacking model does not properly inherit from the appropriate Scikit-learn base classes.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.