Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AxisError: axis 1 is out of bounds for array of dimension 1 while using RandomForestClassifier #19

Open
erastogi opened this issue Nov 1, 2018 · 1 comment

Comments

@erastogi
Copy link

erastogi commented Nov 1, 2018

here is the code to replicate the issue:
inp = np.array([[-1, -1],
[-2, -1],
[1, 1],
[2, 1]])

model = sklearn.ensemble.RandomForestClassifier().fit(inp, [1,1,0,0])
predictions, bias, contributions = ti.predict(model, inp)

Error occurs at line 63 in treeinterpreter.py in _predict_tree(model, X, joint_contribution)

This is because not all model.estimator_ return tree_ values as 2D.

@Marcnuth
Copy link

This bug is fixed in the latest version, try to update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants