Skip to main content
`Ctrl`+`K`

# `skopt.plots`.partial_dependence_1D

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

  Calculate the partial dependence for a single dimension.

  This uses the given model to calculate the average objective value for all the samples, where the given dimension is fixed at regular intervals between its bounds.

  This shows how the given dimension affects 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 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`.

  Returns:
    xi np.array

      The points at which the partial dependence was evaluated.

    yi np.array

      The average value of the modelled objective function at each point `xi`.