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

sparse array length is ambiguous; use getnnz() or shape[0] #447

Open
CTI2023 opened this issue Oct 31, 2024 · 1 comment
Open

sparse array length is ambiguous; use getnnz() or shape[0] #447

CTI2023 opened this issue Oct 31, 2024 · 1 comment

Comments

@CTI2023
Copy link

CTI2023 commented Oct 31, 2024

I am working on a multi-label classification task. Most of the feature values are zero. The dataset is a binary vector. When I tried to generate the counterfactual, I got the error like sparse array length is ambiguous; use getnnz() or shape[0]

import numpy as np

e = dice.generate_counterfactuals(data, total_CFs=5, desired_class=1)

e.visualize_as_dataframe(show_only_changes=True)

@CTI2023 CTI2023 changed the title parse array length is ambiguous; use getnnz() or shape[0] sparse array length is ambiguous; use getnnz() or shape[0] Oct 31, 2024
@gaugup
Copy link
Collaborator

gaugup commented Nov 22, 2024

@CTI2023 could you share the dataset and code that caused you to run into this issue?

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

No branches or pull requests

2 participants