Skip to content

Add predict_fn_accept_dense_only to explain_instance when input is sparse but model takes dense#705

Open
BinDong314 wants to merge 1 commit intomarcotcr:masterfrom
BinDong314:master
Open

Add predict_fn_accept_dense_only to explain_instance when input is sparse but model takes dense#705
BinDong314 wants to merge 1 commit intomarcotcr:masterfrom
BinDong314:master

Conversation

@BinDong314
Copy link

Add predict_fn_accept_dense_only to explain_instance.

When data_row (of explain_instance) is scipy.sparse.matrix but the model was NOT trained with scipy.sparse.matrix, the predict_fn_accept_dense_only convert inverse to dense before call predict_fn (and then back to sparse after call predict_fn)

Bin dbin@lbl.gov

Add predict_fn_accept_dense_only to explain_instance.
When data_row is scipy.sparse.matrix but the model was not trained with scipy.sparse.matrix, the predict_fn_accept_dense_only convert inverse to dense before call predict_fn (and then back to sparse after call predict_fn)
Bin dbin@lbl.gov
@BinDong314
Copy link
Author

@marcotcr since this only involves a few lines of code change.
Would you mind help to review and merge it?
Thanks

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

Successfully merging this pull request may close these issues.

1 participant