Eli5.Sklearn PermutationImportance() -- TypeError: check_cv() takes from 0 to 2 positional arguments but 3 were given

Eli5.Sklearn PermutationImportance() -- TypeError: check_cv() takes from 0 to 2 positional arguments but 3 were given

cv = RepeatedStratifiedKFold(n_splits=5, n_repeats=10, random_state=100)
perm = PermutationImportance(clf.named_steps['classifier'], scoring='roc_auc', cv=cv)
perm.fit(X=x_train_valid_proc, y=y_train_valid)

我是 运行 来自 eli5.sklearn 的排列重要性。我不断收到此错误:

 Traceback (most recent call last):
 cv = check_cv(self.cv, y, is_classifier(self.estimator))
 TypeError: check_cv() takes from 0 to 2 positional arguments but 3 were given

我不确定该怎么做,因为我只将 2 个参数传递给 perm.fit()

如有任何建议,我们将不胜感激。

谢谢

link to error message image

这是一个已知错误,已在衍生存储库的主分支中修复,但尚未在 PyPI 版本中修复。您可以通过直接从 github.

安装来修复它

https://github.com/TeamHG-Memex/eli5/issues/414
https://github.com/eli5-org/eli5/issues/12
https://github.com/eli5-org/eli5/blob/master/eli5/sklearn/permutation_importance.py#L214