.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/dataset/use_cases/plot_rosenbrock.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_dataset_use_cases_plot_rosenbrock.py: Rosenbrock dataset ================== This :class:`.Dataset` contains 100 evaluations of the well-known Rosenbrock function: .. math:: f(x,y)=(1-x)^2+100(y-x^2)^2 This function is known for its global minimum at point (1,1), its banana valley and the difficulty to reach its minimum. This :class:`.Dataset` is based on a full-factorial design of experiments. `More information about the Rosenbrock function `_ .. GENERATED FROM PYTHON SOURCE LINES 41-52 .. code-block:: Python from __future__ import annotations from gemseo import configure_logger from gemseo import create_benchmark_dataset from gemseo.post.dataset.yvsx import YvsX from gemseo.post.dataset.zvsxy import ZvsXY configure_logger() .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 53-57 Load Rosenbrock dataset ----------------------- We can easily load this dataset by means of the high-level function :func:`.create_benchmark_dataset`: .. GENERATED FROM PYTHON SOURCE LINES 57-61 .. code-block:: Python dataset = create_benchmark_dataset("RosenbrockDataset") dataset .. raw:: html
GROUP designs objectives
VARIABLE x rosen
COMPONENT 0 1 0
1 -2.000000 -2.0 3609.000000
2 -1.555556 -2.0 1959.952599
3 -1.111111 -2.0 1050.699741
4 -0.666667 -2.0 600.308642
5 -0.222222 -2.0 421.490779
... ... ... ...
6 0.222222 2.0 381.095717
7 0.666667 2.0 242.086420
8 1.111111 2.0 58.600975
9 1.555556 2.0 17.927907
10 2.000000 2.0 401.000000

100 rows × 3 columns



.. GENERATED FROM PYTHON SOURCE LINES 62-64 Show the design data -------------------- .. GENERATED FROM PYTHON SOURCE LINES 64-66 .. code-block:: Python dataset.design_dataset .. raw:: html
GROUP designs
VARIABLE x
COMPONENT 0 1
1 -2.000000 -2.0
2 -1.555556 -2.0
3 -1.111111 -2.0
4 -0.666667 -2.0
5 -0.222222 -2.0
... ... ...
6 0.222222 2.0
7 0.666667 2.0
8 1.111111 2.0
9 1.555556 2.0
10 2.000000 2.0

100 rows × 2 columns



.. GENERATED FROM PYTHON SOURCE LINES 67-69 Show the objective data ----------------------- .. GENERATED FROM PYTHON SOURCE LINES 69-71 .. code-block:: Python dataset.objective_dataset .. raw:: html
GROUP objectives
VARIABLE rosen
COMPONENT 0
1 3609.000000
2 1959.952599
3 1050.699741
4 600.308642
5 421.490779
... ...
6 381.095717
7 242.086420
8 58.600975
9 17.927907
10 401.000000

100 rows × 1 columns



.. GENERATED FROM PYTHON SOURCE LINES 72-74 Load the data with an input-output naming ----------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 74-77 .. code-block:: Python dataset = create_benchmark_dataset("RosenbrockDataset", opt_naming=False) dataset .. raw:: html
GROUP inputs outputs
VARIABLE x rosen
COMPONENT 0 1 0
0 -2.000000 -2.0 3609.000000
1 -1.555556 -2.0 1959.952599
2 -1.111111 -2.0 1050.699741
3 -0.666667 -2.0 600.308642
4 -0.222222 -2.0 421.490779
... ... ... ...
95 0.222222 2.0 381.095717
96 0.666667 2.0 242.086420
97 1.111111 2.0 58.600975
98 1.555556 2.0 17.927907
99 2.000000 2.0 401.000000

100 rows × 3 columns



.. GENERATED FROM PYTHON SOURCE LINES 78-80 Plot the data ------------- .. GENERATED FROM PYTHON SOURCE LINES 80-83 .. code-block:: Python ZvsXY(dataset, x=("x", 0), y=("x", 1), z="rosen").execute(save=False, show=True) YvsX(dataset, x=("x", 0), y="rosen").execute(save=False, show=True) .. rst-class:: sphx-glr-horizontal * .. image-sg:: /examples/dataset/use_cases/images/sphx_glr_plot_rosenbrock_001.png :alt: rosen :srcset: /examples/dataset/use_cases/images/sphx_glr_plot_rosenbrock_001.png :class: sphx-glr-multi-img * .. image-sg:: /examples/dataset/use_cases/images/sphx_glr_plot_rosenbrock_002.png :alt: plot rosenbrock :srcset: /examples/dataset/use_cases/images/sphx_glr_plot_rosenbrock_002.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none [
] .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.314 seconds) .. _sphx_glr_download_examples_dataset_use_cases_plot_rosenbrock.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_rosenbrock.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_rosenbrock.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_