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

[ENH] refactored ColumnConcatenator, rewrite using pd-multiindex inner type #2379

Merged
merged 11 commits into from Jul 24, 2022

Conversation

fkiraly
Copy link
Collaborator

@fkiraly fkiraly commented Apr 3, 2022

This PR is a rewrite of the ColumnConcatenator, using pd-multiindex.
Originally in #2369.

The conversion issues are fixed now, should all be good to go.

Relies on the fix to data loaders to ensure unique input index:
#3031


from first post:

Unfortunately, this has dredged up all kinds of issues with type casting and conversion, so I am isolating it to one PR and removing it from #2369.

The failures in this refactor are linked to the failures in the conversions here: #2375, since in the tests we make conversions between the nested data frame format and the pd-multiindex format.

@fkiraly fkiraly added module:transformations transformations module: time series transformation, feature extraction, pre-/post-processing refactor Restructuring without changing its external behavior. Neither fixing a bug nor adding a feature. labels Apr 3, 2022
@fkiraly
Copy link
Collaborator Author

fkiraly commented Jul 16, 2022

Test failure is due to #1290 - the old ColumnConcatenator with its byzantine code was apparently able to cope with repeated instance indices, whereas the pandas native functionality breaks. Fix in #3029.

@fkiraly fkiraly changed the title [ENH] refactored ColumnConcatenator, rewrite using pd-multiindex [ENH] refactored ColumnConcatenator, rewrite using pd-multiindex inner type Jul 16, 2022
fkiraly added a commit that referenced this pull request Jul 23, 2022
This fixes a recurring issue with duplicated indices from the time series classification datasets. This has been repeatedly breaking things downstream and made refactors difficult. Fixes #1290, fixes #2331 for the instance index, addresses the example in #1893 fixes the problem that prevents #2379 to be refactored.

The fix makes changes in the `datasets` module that ensures unique index for loaded time series classification datasets, via `reset_index(drop=True)`

Note: this does *not* prohibit duplicate time index, only duplicate instance name (index of the outer `DataFrame` in `nested_univ`).
fkiraly added a commit that referenced this pull request Jul 23, 2022
…nstance index in `sktime` datasets (#3029)

This fixes a recurring issue with duplicated indices from the time series classification datasets. This has been repeatedly breaking things downstream and made refactors difficult. Fixes #1290, fixes #2331 for the instance index, addresses the example in #1893 fixes the problem that prevents #2379 to be refactored.

Initial bug report about duplicate indices: #1290

Nature of the fix:
* adds a check for `nested_univ` mtype that prohibits duplicate instance index
* fixes an instance of duplicate indices in the benchmarking module
* ensures that any `nested_univ` returns of the old `SeriesToSeriesRowTransformer` have unique instance index

Note: this does *not* prohibit duplicate time index, only duplicate instance name (index of the outer `DataFrame` in `nested_univ`).
@fkiraly fkiraly merged commit ec41ee5 into main Jul 24, 2022
@fkiraly fkiraly deleted the Columnconcatenator-refactored branch July 24, 2022 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:transformations transformations module: time series transformation, feature extraction, pre-/post-processing refactor Restructuring without changing its external behavior. Neither fixing a bug nor adding a feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant