Calculate mean_n_absolute_max for all three configured maxima - #1128
Open
VenishPaneliya wants to merge 1 commit into
Open
Calculate mean_n_absolute_max for all three configured maxima#1128VenishPaneliya wants to merge 1 commit into
VenishPaneliya wants to merge 1 commit into
Conversation
The parameters for mean_n_absolute_max were written as a single dictionary
repeating the same key:
"mean_n_absolute_max": [
{
"number_of_maxima": 3,
"number_of_maxima": 5,
"number_of_maxima": 7,
}
],
A dictionary literal keeps only the last value for a repeated key, so this
collapsed to [{"number_of_maxima": 7}] and ComprehensiveFCParameters asked
for one feature instead of three. Extracting with the comprehensive settings
silently produced only mean_n_absolute_max__number_of_maxima_7.
Use the same comprehension the neighbouring entries use so all three
settings survive.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In
ComprehensiveFCParameters, the settings formean_n_absolute_maxare written as a single dictionary that repeats the same key:A dict literal keeps only the last value for a repeated key, so this collapses to
[{"number_of_maxima": 7}]. Only one feature is requested instead of three, and the settings for 3 and 5 are silently dropped.Every neighbouring entry in the same block builds its parameter list with a comprehension (
lempel_ziv_complexity,fourier_entropy,permutation_entropy,matrix_profile), which is what makes the intent here clear — three separate settings, not one dictionary.Reproduction
On released tsfresh 0.21.2:
End to end, the two other features never get calculated:
After the change:
Changes
Tests
Added
test_mean_n_absolute_max_correctly_configured, following the existingtest_range_count_correctly_configuredstyle. It asserts the configured maxima are[3, 5, 7]; before the change it fails withLists differ: [7] != [3, 5, 7].tests/units/feature_extraction/test_settings.pyandtest_extraction.py: 34 passed.blackandisort --profile blackapplied to both changed files.Note
Anyone using
ComprehensiveFCParametersnow gets two additionalmean_n_absolute_maxcolumns that were previously missing, so extracted feature matrices will be slightly wider. That is the intended set, but flagging it since it changes default output.Incidentally, this is the same dictionary-key collapse that came up in #1072, where the reported list had the same shape — the copy in
settings.pylooks like it was missed at the time.