mo.pareto.mo_xy_contour
mo.pareto.mo_xy_contour(
models,
bounds,
target_names=None,
feature_names=None,
resolution=50,
feature_pairs=None,
**kwargs,
)
Generates contour plots of every combination of two input variables x_i and x_j (where i < j) and for each of the multiple objectives f_k.
Parameters
| models |
list |
List of trained models (one per objective). |
required |
| bounds |
list |
List of tuples (min, max) for each input variable. |
required |
| target_names |
list |
List of names for the objectives. Defaults to None. |
None |
| feature_names |
list |
List of names for the input variables. Defaults to None. |
None |
| resolution |
int |
Grid resolution for the contour plot. Defaults to 50. |
50 |
| feature_pairs |
list |
List of tuples (i, j) specifying which feature pairs to plot. If None, all combinations are plotted. Defaults to None. |
None |
| **kwargs |
Any |
Additional keyword arguments passed to plt.subplots (e.g., figsize). |
{} |
Examples
>>> from sklearn.ensemble import RandomForestRegressor
>>> from spotoptim.mo.pareto import mo_xy_contour
>>> import numpy as np
>>> # Train dummy models
>>> X = np.random.rand(10, 2)
>>> y1 = X[:, 0] + X[:, 1]
>>> y2 = X[:, 0] * X[:, 1]
>>> m1 = RandomForestRegressor().fit(X, y1)
>>> m2 = RandomForestRegressor().fit(X, y2)
>>> # Plot
>>> mo_xy_contour([m1, m2], bounds=[(0, 1), (0, 1)], target_names=["Sum", "Prod"])