Skater icon indicating copy to clipboard operation
Skater copied to clipboard

TypeError: 'NoneType' object is not subscriptable - A problem with the n_samples parameter in plot_feature_importance

Open OivindBirk opened this issue 4 years ago • 0 comments

I have come across an error in the plot_feature_importance method, relating to the n_samples parameter. When the parameter is set lower than the size of the test set (or train set if the Interpretation object is based on that), the TypeError: 'NoneType' object is not subscriptable, occurs. As long as the n_samples parameter is set higher than the size of the relevant dataset, everything works fine.

The code in the attached pdf was run in a Google Colab environment, with python 3.6 and skater 1.1.2. I followed the example from your documentation: https://github.com/oracle/Skater/blob/master/examples/explaining_classification_breast_cancer.ipynb

When applying a much larger dataset than the one in the example, the problem is more critical, as plotting feature importance with a large sample size takes a very long time.

feature_importance_error.pdf

OivindBirk avatar May 01 '20 11:05 OivindBirk