Skip to content

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

Description

@CTI2023

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)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions