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

New outcome space and encoding: BubbleSortSwaps and BubbleSortSwapsEncoding #390

Merged
merged 16 commits into from
Jan 16, 2024

Conversation

kahaaga
Copy link
Member

@kahaaga kahaaga commented Jan 16, 2024

As discussed in #384.

  • Added BubbleSortSwaps outcome space, which when used to encode data, first embeds the data, then counts for each state vector the number of swaps necessary for the bubble sort algorithm to sort it.
  • Added BubbleSortSwapsEncoding, which takes care of the actual encoding.
  • Implemented codify, which uses BubbleSortSwapsEncoding and is used internally by BubbleSortSwaps.
  • Added BubbleEntropy <: ComplexityEstimator, which implements both complexity and complexity_normalized, and computes a (normalized) difference between entropies for dimensions m + 1 and m. In the original paper, Renyi entropy of order q = 2 was used, but thanks to information_maximum, we can use any InformationMeasure.
  • Tests.
  • Documentation entries.
  • Example showing how to compute the "bubble entropy".

Copy link

codecov bot commented Jan 16, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (c191814) 88.80% compared to head (eea2c66) 89.00%.

Files Patch % Lines
...ding_implementations/bubble_sort_swaps_encoding.jl 96.15% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #390      +/-   ##
==========================================
+ Coverage   88.80%   89.00%   +0.20%     
==========================================
  Files          82       85       +3     
  Lines        2393     2447      +54     
==========================================
+ Hits         2125     2178      +53     
- Misses        268      269       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@Datseris Datseris left a comment

Choose a reason for hiding this comment

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

LGTM, only minor comments

src/complexity_measures/bubble_entropy.jl Outdated Show resolved Hide resolved
src/complexity_measures/bubble_entropy.jl Outdated Show resolved Hide resolved
src/complexity_measures/bubble_entropy.jl Outdated Show resolved Hide resolved
src/encoding_implementations/bubble_sort_swaps_encoding.jl Outdated Show resolved Hide resolved
src/encoding_implementations/bubble_sort_swaps_encoding.jl Outdated Show resolved Hide resolved
src/outcome_spaces/bubble_sort_swaps.jl Outdated Show resolved Hide resolved
src/outcome_spaces/bubble_sort_swaps.jl Show resolved Hide resolved
src/outcome_spaces/bubble_sort_swaps.jl Outdated Show resolved Hide resolved
src/outcome_spaces/bubble_sort_swaps.jl Outdated Show resolved Hide resolved
src/outcome_spaces/bubble_sort_swaps.jl Outdated Show resolved Hide resolved
@kahaaga kahaaga merged commit 89c61a8 into main Jan 16, 2024
4 checks passed
@kahaaga kahaaga deleted the bubble branch January 16, 2024 22:12
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.

2 participants