parrt / random-forest-importances

Code to compute permutation and drop-column importances in Python scikit-learn models
MIT License
600 stars 131 forks source link

An error occurred when the test file was run #53

Open LilWei-DU opened 2 years ago

LilWei-DU commented 2 years ago

I got an error running "permutation-importances-classifier", “forest” seems to be updated to “_forest” in sklearn. I changed "from sklearn.ensemble.forest import _generate_unsampled_indices" to "from sklearn.ensemble._forest import _generate_unsampled_indices" and it worked fine.

In the same code, "unsampled_indices = _generate_unsampled_indices(tree.random_state, n_samples)" shows missing "TypeError: _generate_unsampled_indices() missing 1 required positional argument: 'n_samples_bootstrap'" when running. The function of _generate_unsampled_indices is defined as: "def _generate_unsampled_indices(random_state, n_samples, n_samples_bootstrap):".

parrt commented 2 years ago

hmm... I haven't tried in a while but that sounds familiar. I believe we fixed that with a recent version.