Question: How to Resolve "AttributeError: 'super' object has no attribute 'sklearn_tags'" in XGBoost Code?

I am encountering the following error on line 12 of my code: AttributeError: 'super' object has no attribute '__sklearn_tags__'

Here is the code snippet:

from xgboost import XGBRegressor from sklearn.model_selection import GridSearchCV xgb_regressor = XGBRegressor() # Define the parameter grid param_grid = { 'n_estimators': [100, 200, 300], 'max_depth': [3, 4, 5], 'learning_rate': [0.01, 0.1, 0.2], 'subsample': [0.8, 1.0] } grid_search = GridSearchCV( estimator=xgb_regressor, param_grid=param_grid, cv=3, scoring='neg_mean_squared_error', verbose=1, n_jobs=-1 ) grid_search.fit(X_train, y_train) print("Best Parameters:", grid_search.best_params_) print("Best Score:", grid_search.best_score_)

I have reviewed the official documentation but could not find a solution that resolves the issue effectively.

Could someone suggest potential causes and solutions for this error?

Any guidance or experience with similar issues would be greatly appreciated!

This version is concise, clear, and emphasizes the error while requesting help constructively.

Let me know if you'd like to add more details!

More Sahas V Swamy's questions See All
Similar questions and discussions