model1 = BaggingClassifier(base_estimator=KNeighborsClassifier(),n_estimators=20,random_state=0).fit(X_train, y_train)
y_pred = model1.predict(X_test) #predict model
this is the code and error i was getting is
TypeError Traceback (most recent call last)
Cell In[23], line 1
—-> 1 model1 = BaggingClassifier(base_estimator=KNeighborsClassifier(),n_estimators=20,random_state=0).fit(X_train, y_train)
2 y_pred = model1.predict(X_test) #predict model
TypeError: BaggingClassifier.init() got an unexpected keyword argument ‘base_estimator’
need some suggestion
please help me with this issue and please tell me whats wrong going
sai madhu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.