-
Notifications
You must be signed in to change notification settings - Fork 294
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
CrossValidationPlot object #2252
base: main
Are you sure you want to change the base?
Conversation
This pull request was exported from Phabricator. Differential Revision: D54432757 |
Summary: CrossValidation is one of the most frequent plots used accross Ax. This change imports it to the ax.analysis module, simplifies its logic and provides a easy to use access point, which takes in the common `experiment` and `model` data types. - "get_df()" exports a basic dataframe with the data used to generate the plot - "get_fig()" exports the classic cross validation plots, with the same functionality as used today. ## New Usage ``` from ax.analysis.cross_validation_plot import CrossValidationPlot cv_plot = CrossValidationPlot(experiment=scheduler.experiment, model=model) plot = cv_plot.get_fig() ``` ## Old Usage ``` from ax.plot.diagnostic import interact_cross_validation_plotly from ax.modelbridge.cross_validation import cross_validate cv_results = cross_validate(model=model) plot = interact_cross_validation_plotly(cv_results) ``` Differential Revision: D54432757
dc8d757
to
8a5594b
Compare
This pull request was exported from Phabricator. Differential Revision: D54432757 |
Summary: CrossValidation is one of the most frequent plots used accross Ax. This change imports it to the ax.analysis module, simplifies its logic and provides a easy to use access point, which takes in the common `experiment` and `model` data types. - "get_df()" exports a basic dataframe with the data used to generate the plot - "get_fig()" exports the classic cross validation plots, with the same functionality as used today. ## New Usage ``` from ax.analysis.cross_validation_plot import CrossValidationPlot cv_plot = CrossValidationPlot(experiment=scheduler.experiment, model=model) plot = cv_plot.get_fig() ``` ## Old Usage ``` from ax.plot.diagnostic import interact_cross_validation_plotly from ax.modelbridge.cross_validation import cross_validate cv_results = cross_validate(model=model) plot = interact_cross_validation_plotly(cv_results) ``` Differential Revision: D54432757
8a5594b
to
ecd9e78
Compare
This pull request was exported from Phabricator. Differential Revision: D54432757 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2252 +/- ##
========================================
Coverage 94.86% 94.87%
========================================
Files 467 476 +9
Lines 46455 46726 +271
========================================
+ Hits 44068 44329 +261
- Misses 2387 2397 +10 ☔ View full report in Codecov by Sentry. |
Summary: CrossValidation is one of the most frequent plots used accross Ax. This change imports it to the ax.analysis module, simplifies its logic and provides a easy to use access point, which takes in the common `experiment` and `model` data types. - "get_df()" exports a basic dataframe with the data used to generate the plot - "get_fig()" exports the classic cross validation plots, with the same functionality as used today. ## New Usage ``` from ax.analysis.cross_validation_plot import CrossValidationPlot cv_plot = CrossValidationPlot(experiment=scheduler.experiment, model=model) plot = cv_plot.get_fig() ``` ## Old Usage ``` from ax.plot.diagnostic import interact_cross_validation_plotly from ax.modelbridge.cross_validation import cross_validate cv_results = cross_validate(model=model) plot = interact_cross_validation_plotly(cv_results) ``` Differential Revision: D54432757
ecd9e78
to
3803c9a
Compare
This pull request was exported from Phabricator. Differential Revision: D54432757 |
Summary: To prepare of creating the "CrossValidationPlot" module, this change imports the dependent code from "ax.plots". It also cleans up the original code by breaking it apart into different helper files, and trimming out methods which are not used to create this plot. Some new unit tests are being added as well. ## In new ax.analysis CrossValidationPlot The function of the code is broken out neatly by function: Constants, string operations, basic formatting helpers - ax/analysis/helpers/constants.py - 21 lines - ax/analysis/helpers/color_helpers.py - 33 lines - ax/analysis/helpers/plot_helpers.py - 76 lines - ax/analysis/helpers/layout_helpers.py - 96 lines Plot Logic - ax/analysis/helpers/scatter_helpers.py - 180 lines - ax/analysis/helpers/cross_validation_helpers.py - 291 lines CrossValidationPlot object (see next diff) - ax/analysis/cross_validation_plot.py - 109 lines 806 total lines ## Required files from ax.plot needed to create cross validation plot - ax/plot/scatter.py - 1722 lines - ax/plot/diagnostic.py - 691 lines - ax/plot/helper - 995 lines - ax/plot/base.py - 94 lines - ax/plot/color.py - 120 lines 3622 total lines of code across the files which have the logic for cross validation plots This is a 77.75% decrease in lines of code. This will make understanding and using this plot easier for users and developers. Differential Revision: D54495372
Summary: CrossValidation is one of the most frequent plots used accross Ax. This change imports it to the ax.analysis module, simplifies its logic and provides a easy to use access point, which takes in the common `experiment` and `model` data types. - "get_df()" exports a basic dataframe with the data used to generate the plot - "get_fig()" exports the classic cross validation plots, with the same functionality as used today. ## New Usage ``` from ax.analysis.cross_validation_plot import CrossValidationPlot cv_plot = CrossValidationPlot(experiment=scheduler.experiment, model=model) plot = cv_plot.get_fig() ``` ## Old Usage ``` from ax.plot.diagnostic import interact_cross_validation_plotly from ax.modelbridge.cross_validation import cross_validate cv_results = cross_validate(model=model) plot = interact_cross_validation_plotly(cv_results) ``` Differential Revision: D54432757
3803c9a
to
1badbc7
Compare
This pull request was exported from Phabricator. Differential Revision: D54432757 |
Summary:
CrossValidation is one of the most frequent plots used accross Ax. This change imports it to the ax.analysis module, simplifies its logic and provides a easy to use access point, which takes in the common
experiment
andmodel
data types.plot
New Usage
Old Usage
Differential Revision: D54432757