Skip to content

Implement Shannon Entropy Macro #17

Description

@Matts52

Implement a macro that calculates the shannon entropy for categorical columns. Something like the following would likely do it:

    -sum((count({{ column }}) over (partition by {{ column }}) * 1.0 / count(*) over ()) 
        * log(count({{ column }}) over (partition by {{ column }}) * 1.0 / count(*) over ())) over ()

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions