Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Feature Request - Parallel Coordinates Plot for GridSearch result analysisΒ #24281

Open
@julien-blanchon

Description

@julien-blanchon

Describe the workflow you want to enable

GridSearch result are hard to analyze expecially when param_grid is very large.

The current documentation show usages of:

  • matrix_plot/pivot. That can visualize the relationship beetween 2 params for 1 metrics (2D).
  • line plot. Each line represent a 1D (1 params vs 1 metrics) relationship and by taking multiple line when can visualize at least 2D relationship, but this became mess for more.
  • box plot. Same conclusion as for line plot but using box instead.

None of these plot can represent nicely more then a 2D relationship. 3D, 4D and more can be visualize by making a bunch of basic 2D plot, but the number plot will easily became huge and we lost relationship beetween some params. This get even worse with RandomizedSearchCV as the params are not evenly compute.

One common way to represent N-D relationship without loss is to use Parallel Coordinates Plot:

Example of Parallel Coordinates Plot of the proposed implementation

The current implementation of PC Plot are:

  • Plotly express. But it don't integrate well with the param_grid format. Plus is not matplotlib compatible.
  • Tensorboard and deep learning experiement tracker (wandb ...). Same don't integrate weel, not matplotlib stack and need even more conversion work and a web server (or cloud account :()
  • Handmade matplotlib implementation. Matplotlib compatible, but at the time we don't have any easy to use implementation from common package. + with param_grid format compatibility.

Describe your proposed solution

I presently use my own implementation of matplotlib PC Plot (see the image above) for my work.
The current interface is:

def plot_parallel_coordinates(
        grid_model: GridSearchCV, 
        params: list[str] = ["params"],
        scoring: str = ["mean_test_score"]
        cmap : Optional[str] = None,
        ax: Optional[plt.Axes] = None) -> plt.Axes

If think the community could benefith from using a common and scikit-learn integrated implementation (for example in metrics.ParallelCoordinatesPlot or inspection.ParallelCoordinatesPlot and with plot_parallel_coordinates function)

Describe alternatives you've considered, if relevant

No response

Additional context

Please give πŸ‘ if you think this could be benefith, so we can start discuss implementation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Discussion

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions