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 entropy #468

Merged
merged 2 commits into from Feb 27, 2019
Merged

fix entropy #468

merged 2 commits into from Feb 27, 2019

Conversation

matbesancon
Copy link
Member

There was a bug in the definition of entropy, we should have entropy of a Dirac peak = 0.0

src/scalarstats.jl Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Feb 27, 2019

Codecov Report

Merging #468 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #468      +/-   ##
==========================================
+ Coverage   85.05%   85.09%   +0.03%     
==========================================
  Files          21       21              
  Lines        2088     2093       +5     
==========================================
+ Hits         1776     1781       +5     
  Misses        312      312
Impacted Files Coverage Δ
src/StatsBase.jl 100% <ø> (ø) ⬆️
src/scalarstats.jl 87.61% <100%> (+0.29%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0c4d0a5...11ef5d3. Read the comment docs.

@codecov
Copy link

codecov bot commented Feb 27, 2019

Codecov Report

Merging #468 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #468   +/-   ##
=======================================
  Coverage   85.05%   85.05%           
=======================================
  Files          21       21           
  Lines        2088     2088           
=======================================
  Hits         1776     1776           
  Misses        312      312
Impacted Files Coverage Δ
src/StatsBase.jl 100% <ø> (ø) ⬆️
src/scalarstats.jl 87.32% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0c4d0a5...11ef5d3. Read the comment docs.

@matbesancon matbesancon merged commit d7f2e07 into master Feb 27, 2019
@matbesancon matbesancon deleted the fix-entropy branch February 27, 2019 16:12
@oxinabox
Copy link
Contributor

You really should have added to the docstring about this behaviour.

@@ -119,6 +119,8 @@ it = (xᵢ for xᵢ in x)

@test entropy([0.5, 0.5],2) ≈ 1.0
@test entropy([0.2, 0.3, 0.5], 2) ≈ 1.4854752972273344
@test entropy([0.2, 0.3, 0.5], 2) ≈ 1.4854752972273344

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, it looks like you duplicated one of the tests here.

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

Successfully merging this pull request may close these issues.

None yet

6 participants