8000 wrong input into entropy function · Issue #14497 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content
wrong input into entropy function #14497
Closed
@minhsphuc12

Description

@minhsphuc12

h_true, h_pred = entropy(labels_true), entropy(labels_pred)

entropy must be inputed with frequency table of labels_true / labels_pred, not those array directly.
Example solution

from collections import Counter
freq_table = [x[1] for x in dict(Counter(labels_true)).items()]
entropy(freq_table)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0