Skip to main content
Glama

plot_edf

Generate an Empirical Distribution Function (EDF) plot to visualize the distribution of optimization objective values. Specify the target index and name for precise analysis of Optuna optimization results.

Instructions

Return the EDF plot as an image.

Args: target: An index to specify the value to display. To plot nth objective value, set this to n. Note that this is 0-indexed, i.e., to plot the first objective value, set this to 0. target_name: Target’s name to display on the axis label.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetNo
target_nameNoObjective Value

Implementation Reference

  • The `plot_edf` tool handler: generates an Empirical Distribution Function (EDF) plot of the study's objective values using `optuna.visualization.plot_edf`, converts it to PNG image using Plotly, and returns an MCP `Image` object.
    @mcp.tool() def plot_edf( target: int = 0, target_name: str = "Objective Value", ) -> Image: """Return the EDF plot as an image. Args: target: An index to specify the value to display. To plot nth objective value, set this to n. Note that this is 0-indexed, i.e., to plot the first objective value, set this to 0. target_name: Target’s name to display on the axis label. """ fig = optuna.visualization.plot_edf( mcp.study, target=lambda t: t.values[target], target_name=target_name, ) return Image(data=plotly.io.to_image(fig), format="png")

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/optuna/optuna-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server