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

[timeseries] Fix PerformanceWarning in AutoGluonTabularModel #2817

Merged
merged 1 commit into from
Feb 3, 2023

Conversation

shchur
Copy link
Collaborator

@shchur shchur commented Feb 2, 2023

Description of changes:

  • When training AutoGluonTabular model with both past & known covariates, the following warning is raised by pandas

/local/home/shchuro/workspace/autogluon/timeseries/src/autogluon/timeseries/models/autogluon_tabular/tabular_model.py:230: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling frame.insert many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use newframe = frame.copy()

This happens at line

  features[self.target] = time_series[self.target]

This PR replaces column insertion with a concatenation, which fixes this warning.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@shchur shchur changed the title [timeseries] Fix performance warning in AutoGluonTabularModel [timeseries] Fix PerformanceWarning in AutoGluonTabularModel Feb 2, 2023
@shchur shchur requested a review from tonyhoo February 2, 2023 17:41
@github-actions
Copy link

github-actions bot commented Feb 2, 2023

Job PR-2817-e85f7ae is done.
Docs are uploaded to http://autogluon-staging.s3-website-us-west-2.amazonaws.com/PR-2817/e85f7ae/index.html

@shchur shchur merged commit e0f544f into autogluon:master Feb 3, 2023
@shchur shchur deleted the fix-tabular-performancewarning branch February 3, 2023 03:55
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

2 participants