TypeError when trying to explain weights of XGBoost Classifier

515 views Asked by At

I am working on implementing XGBoost on the Titanic dataset provided by Kaggle. I found the package ELI5 and the tutorial for implementing this package with XGBoost on the Titanic dataset at this link on the official documentation for ELI 5 (Jupyter Notebook tutorial). While on the third section of the notebook, I attempt to apply the show_weights() function to my classifier, but I get the following error after running these lines of code.

[1]from eli5 import show_weights, explain_weights
[2]show_weights(clf, vec=vec)

Out[2]: TypeError: 'NoneType' object is not iterable

Clearly it's not interpreting the clf object created in section 2. There's no information of the ELI5 package being incompatible with XGBoost in either packages' documentation.

1

There are 1 answers

1
jortizta On

I can reproduce that same error when using ELI5 with XGBoost 1.4.0.

However, with XGBoost version 1.3.0 and earlier versions the error goes away.

Downgrade if you can.