Skip to main content
`Ctrl`+`K`

# `skopt.plots`.partial_dependence_2D

skopt.plots.partial_dependence_2D(space, model, i, j, samples, n_points=40)

  Calculate the partial dependence for two dimensions in the search-space.

  This uses the given model to calculate the average objective value for all the samples, where the given dimensions are fixed at regular intervals between their bounds.

  This shows how the given dimensions affect the objective value when the influence of all other dimensions are averaged out.

  Parameters:
    space `Space`

      The parameter space over which the minimization was performed.

    model

      Surrogate model for the objective function.

    i int

      The first dimension for which to calculate the partial dependence.

    j int

      The second dimension for which to calculate the partial dependence.

    samples np.array, shape=(n_points, n_dims)

      Randomly sampled and transformed points to use when averaging the model function at each of the `n_points` when using partial dependence.

    n_points int, default=40

      Number of points at which to evaluate the partial dependence along each dimension `i` and `j`.

  Returns:
    xi np.array, shape=n_points

      The points at which the partial dependence was evaluated.

    yi np.array, shape=n_points

      The points at which the partial dependence was evaluated.

    zi np.array, shape=(n_points, n_points)

      The average value of the objective function at each point `(xi, yi)`.