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

fix: indexing wrt class_names & relevant issues #53

Merged
merged 1 commit into from Oct 9, 2019

Conversation

4SkyNet
Copy link
Contributor

@4SkyNet 4SkyNet commented Oct 9, 2019

Thx for your cool work wrt dtreeviz package!

But, I've recently encountered with some issues, for example:

  • if you have not ordered class_names (suppose not from zero):
    np.unique[y] => [1, 2, 3]
  • you get class names (if you provide them as sequence):
    {0: 1, 1: 2, 2: 3}
    and...
    for i, c in enumerate(class_values):
        print(i, c)
        box = patches.Rectangle((0, 0), 20, 10, linewidth=.4, edgecolor=GREY,
                                facecolor=colors[c], label=class_names[c])

This code cause the error

  • if we manually provide dict via existing list:
    {val: idx for idx, val in enumerate(class_names)}
    We also fall in error there:
X_hist = [X[y == cl] for cl in class_values]
for cl in enumerate(class_values):
    hist, foo = np.histogram(X_hist[cl], bins=bins, range=overall_feature_range)

@parrt parrt added the bug Something isn't working label Oct 9, 2019
@parrt parrt merged commit 1bd00a1 into parrt:master Oct 9, 2019
@parrt parrt added this to the 0.7 milestone Oct 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants