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

Bagging Classifier error #40

Closed
V1sh18 opened this issue Apr 19, 2024 · 1 comment
Closed

Bagging Classifier error #40

V1sh18 opened this issue Apr 19, 2024 · 1 comment

Comments

@V1sh18
Copy link

V1sh18 commented Apr 19, 2024

I'm attaching the line of code and the error as reference. My code uses sklearn and when i tried to use the same in scikit learn it is not working. (Jupyter Labs)
bagging_classifier = BaggingClassifier(base_estimator=base_classifier, n_estimators=n_estimators,
bootstrap_features=False, max_samples=1.0, max_features=1.0,
bootstrap=True, oob_score=False, n_jobs=None,
warm_start=False, random_state=42, verbose=0)

TypeError Traceback (most recent call last)
Cell In[13], line 20
17 n_estimators = 10
19 # Create the Bagging classifier
---> 20 bagging_classifier = BaggingClassifier(base_estimator=base_classifier, n_estimators=n_estimators,
21 bootstrap_features=False, max_samples=1.0, max_features=1.0,
22 bootstrap=True, oob_score=False, n_jobs=None,
23 warm_start=False, random_state=42, verbose=0)
25 # Train the Bagging classifier
26 bagging_classifier.fit(X_train, y_train)

TypeError: BaggingClassifier.init() got an unexpected keyword argument 'base_estimator'

@GaelVaroquaux
Copy link
Member

This is the wrong repository.

Also, please consult the documentation of scikit-learn for your problem
https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.BaggingClassifier.html

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

2 participants