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-#5545: Align error-handling logic with pandas for groupby.skew #5558

Merged
merged 1 commit into from
Jan 19, 2023

Conversation

dchigarev
Copy link
Collaborator

@dchigarev dchigarev commented Jan 18, 2023

Signed-off-by: Dmitry Chigarev dmitry.chigarev@intel.com

What do these changes do?

The PR aligns modin's behavior with pandas' logic on how to behave on invalid results for groupby.skew.

  • first commit message and PR title follow format outlined here

    NOTE: If you edit the PR title to match this format, you need to add another commit (even if it's empty) or amend your last commit for the CI job that checks the PR title to pick up the new PR title.

  • passes flake8 modin/ asv_bench/benchmarks scripts/doc_checker.py
  • passes black --check modin/ asv_bench/benchmarks scripts/doc_checker.py
  • signed commit with git commit -s
  • Resolves groupby.skew on Linux produces different from pandas results in case of incorrect input #5545
  • tests added and passing
  • module layout described at docs/development/architecture.rst is up-to-date

groupby.skew() performance hasn't changed significantly:

ASV benchmarks

Steps to run the benchmarks were taken from #5318

       before           after         ratio
     [53d9096d]       [959a3eac]
     <master>       <issue-5545>
         338±30ms         358±20ms     1.06  benchmarks.TimeGroupByMultiColumn.time_groupby_agg_skew([1000000, 32], 'huge_amount_groups', 6)
        1.64±0.2s       1.74±0.06s     1.06  benchmarks.TimeGroupByMultiColumn.time_groupby_agg_skew([1000000, 256], 'huge_amount_groups', 6)
        1.79±0.1s       1.89±0.08s     1.06  benchmarks.TimeGroupByMultiColumn.time_groupby_agg_skew([10000000, 32], 100, 6)
         871±20ms         915±50ms     1.05  benchmarks.TimeGroupByMultiColumn.time_groupby_agg_skew([5000, 5000], 'huge_amount_groups', 6)
          383±6ms          402±8ms     1.05  benchmarks.TimeGroupByDefaultAggregations.time_groupby_skew([5000, 5000], 100)
         196±20ms         205±20ms     1.04  benchmarks.TimeGroupByMultiColumn.time_groupby_agg_skew([1000000, 32], 100, 6)
         790±20ms         818±30ms     1.04  benchmarks.TimeGroupByDefaultAggregations.time_groupby_skew([5000, 5000], 'huge_amount_groups')
         189±10ms         196±20ms     1.03  benchmarks.TimeGroupByDefaultAggregations.time_groupby_skew([1000000, 32], 100)
       1.92±0.07s       1.93±0.07s     1.01  benchmarks.TimeGroupByDefaultAggregations.time_groupby_skew([10000000, 32], 'huge_amount_groups')
       1.34±0.03s       1.34±0.02s     1.00  benchmarks.TimeGroupByMultiColumn.time_groupby_agg_skew([1000000, 256], 100, 6)
         474±20ms         472±20ms     1.00  benchmarks.TimeGroupByMultiColumn.time_groupby_agg_skew([5000, 5000], 100, 6)
       1.70±0.06s       1.67±0.06s     0.98  benchmarks.TimeGroupByDefaultAggregations.time_groupby_skew([10000000, 32], 100)
       1.25±0.05s       1.23±0.03s     0.98  benchmarks.TimeGroupByDefaultAggregations.time_groupby_skew([1000000, 256], 100)
       1.52±0.07s       1.48±0.04s     0.97  benchmarks.TimeGroupByDefaultAggregations.time_groupby_skew([1000000, 256], 'huge_amount_groups')

BENCHMARKS NOT SIGNIFICANTLY CHANGED.

…sults for invalid data

Signed-off-by: Dmitry Chigarev <dmitry.chigarev@intel.com>
@dchigarev dchigarev changed the title FIX-#5545: Aligned with pandas default 'groupby.skew' results for invalid data FIX-#5545: Align with pandas default 'groupby.skew' results for invalid data Jan 18, 2023
Comment on lines +2739 to +2741
# Setting dummy values for invalid results in accordance with pandas
skew_res[m2 == 0] = 0
skew_res[count < 3] = np.nan
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@dchigarev dchigarev changed the title FIX-#5545: Align with pandas default 'groupby.skew' results for invalid data FIX-#5545: Align error-handling logic with pandas for groupby.skew Jan 18, 2023
@dchigarev dchigarev marked this pull request as ready for review January 18, 2023 21:24
@dchigarev dchigarev requested a review from a team as a code owner January 18, 2023 21:24
Copy link
Collaborator

@anmyachev anmyachev left a comment

Choose a reason for hiding this comment

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

LGTM!

@anmyachev anmyachev merged commit b234bc3 into modin-project:master Jan 19, 2023
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.

groupby.skew on Linux produces different from pandas results in case of incorrect input
2 participants