Skip to content

BaggingClassifier keyword argument 'base_estimator' not updated with scikit-learn new naming "estimator" #16

@IgnacioCorrecher

Description

@IgnacioCorrecher

Describe the bug

This error occurs because the base_estimator parameter in scikit-learn's BaggingClassifier and BaggingRegressor was renamed to estimator. This change was implemented in scikit-learn version 1.2, and base_estimator was completely removed in version 1.4.

Observed Results

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

Code to Reproduce

from lce import LCEClassifier
from sklearn.datasets import load_iris
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split

data = load_iris()
X_train, X_test, y_train, y_test = train_test_split(data.data, data.target, random_state=0)

clf = LCEClassifier(n_jobs=-1, random_state=0)
clf.fit(X_train, y_train)

Expected Results

No error is thrown.

Version

'0.1.8'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions