Calibration of a polynomial regression

from __future__ import annotations

import matplotlib.pyplot as plt
from gemseo.algos.design_space import DesignSpace
from gemseo.api import configure_logger
from gemseo.mlearning.core.calibration import MLAlgoCalibration
from gemseo.mlearning.qual_measure.mse_measure import MSEMeasure
from gemseo.problems.dataset.rosenbrock import RosenbrockDataset
from matplotlib.tri import Triangulation

Load the dataset

dataset = RosenbrockDataset(opt_naming=False, n_samples=25)

Define the measure

configure_logger()
test_dataset = RosenbrockDataset(opt_naming=False)
measure_options = {"method": "test", "test_data": test_dataset}

Calibrate the degree of the polynomial regression

Define and execute the calibration

calibration_space = DesignSpace()
calibration_space.add_variable("degree", 1, "integer", 1, 10, 1)
calibration = MLAlgoCalibration(
    "PolynomialRegressor",
    dataset,
    ["degree"],
    calibration_space,
    MSEMeasure,
    measure_options,
)
calibration.execute({"algo": "fullfact", "n_samples": 10})
x_opt = calibration.optimal_parameters
f_opt = calibration.optimal_criterion
print("optimal degree:", x_opt["degree"][0])
print("optimal criterion:", f_opt)
    INFO - 16:59:12:
    INFO - 16:59:12: *** Start DOEScenario execution ***
    INFO - 16:59:12: DOEScenario
    INFO - 16:59:12:    Disciplines: MLAlgoAssessor
    INFO - 16:59:12:    MDO formulation: DisciplinaryOpt
    INFO - 16:59:12: Optimization problem:
    INFO - 16:59:12:    minimize criterion(degree)
    INFO - 16:59:12:    with respect to degree
    INFO - 16:59:12:    over the design space:
    INFO - 16:59:12:    +--------+-------------+-------+-------------+---------+
    INFO - 16:59:12:    | name   | lower_bound | value | upper_bound | type    |
    INFO - 16:59:12:    +--------+-------------+-------+-------------+---------+
    INFO - 16:59:12:    | degree |      1      |   1   |      10     | integer |
    INFO - 16:59:12:    +--------+-------------+-------+-------------+---------+
    INFO - 16:59:12: Solving optimization problem with algorithm fullfact:
    INFO - 16:59:12: ...   0%|          | 0/10 [00:00<?, ?it]
    INFO - 16:59:12: ...  10%|█         | 1/10 [00:00<00:00, 182.83 it/sec, obj=5.89e+5]
    INFO - 16:59:12: ...  20%|██        | 2/10 [00:00<00:00, 246.91 it/sec, obj=1.73e+5]
    INFO - 16:59:12: ...  30%|███       | 3/10 [00:00<00:00, 275.81 it/sec, obj=3e+4]
    INFO - 16:59:12: ...  40%|████      | 4/10 [00:00<00:00, 289.31 it/sec, obj=1.1e-24]
    INFO - 16:59:12: ...  50%|█████     | 5/10 [00:00<00:00, 300.27 it/sec, obj=0.11]
    INFO - 16:59:12: ...  60%|██████    | 6/10 [00:00<00:00, 307.06 it/sec, obj=1.18e+3]
    INFO - 16:59:12: ...  70%|███████   | 7/10 [00:00<00:00, 307.70 it/sec, obj=6.9e+3]
    INFO - 16:59:12: ...  80%|████████  | 8/10 [00:00<00:00, 308.36 it/sec, obj=1.36e+4]
    INFO - 16:59:12: ...  90%|█████████ | 9/10 [00:00<00:00, 308.12 it/sec, obj=9.18e+4]
    INFO - 16:59:12: ... 100%|██████████| 10/10 [00:00<00:00, 308.96 it/sec, obj=1.63e+5]
    INFO - 16:59:12: Optimization result:
    INFO - 16:59:12:    Optimizer info:
    INFO - 16:59:12:       Status: None
    INFO - 16:59:12:       Message: None
    INFO - 16:59:12:       Number of calls to the objective function by the optimizer: 10
    INFO - 16:59:12:    Solution:
    INFO - 16:59:12:       Objective: 1.0957626812742524e-24
    INFO - 16:59:13:       Design space:
    INFO - 16:59:13:       +--------+-------------+-------+-------------+---------+
    INFO - 16:59:13:       | name   | lower_bound | value | upper_bound | type    |
    INFO - 16:59:13:       +--------+-------------+-------+-------------+---------+
    INFO - 16:59:13:       | degree |      1      |   4   |      10     | integer |
    INFO - 16:59:13:       +--------+-------------+-------+-------------+---------+
    INFO - 16:59:13: *** End DOEScenario execution (time: 0:00:00.041540) ***
optimal degree: 4
optimal criterion: 1.0957626812742524e-24

Get the history

print(calibration.dataset.export_to_dataframe())
  inputs       outputs
  degree     criterion      learning
       0             0             0
0    1.0  5.888317e+05  8.200828e+05
1    2.0  1.732475e+05  2.404571e+05
2    3.0  3.001292e+04  1.645714e+04
3    4.0  1.095763e-24  1.703801e-24
4    5.0  1.097877e-01  1.391092e-23
5    6.0  1.183264e+03  2.332471e-24
6    7.0  6.895919e+03  1.401963e-23
7    8.0  1.356307e+04  5.192192e-23
8    9.0  9.180547e+04  8.964290e-23
9   10.0  1.625259e+05  8.767875e-23

Visualize the results

degree = calibration.get_history("degree")
criterion = calibration.get_history("criterion")
learning = calibration.get_history("learning")

plt.plot(degree, criterion, "-o", label="test", color="red")
plt.plot(degree, learning, "-o", label="learning", color="blue")
plt.xlabel("polynomial degree")
plt.ylabel("quality")
plt.axvline(x_opt["degree"], color="red", ls="--")
plt.legend()
plt.show()
plot calibration

Calibrate the ridge penalty of the polynomial regression

Define and execute the calibration

calibration_space = DesignSpace()
calibration_space.add_variable("penalty_level", 1, "float", 0.0, 100.0, 0.0)
calibration = MLAlgoCalibration(
    "PolynomialRegressor",
    dataset,
    ["penalty_level"],
    calibration_space,
    MSEMeasure,
    measure_options,
    degree=10,
)
calibration.execute({"algo": "fullfact", "n_samples": 10})
x_opt = calibration.optimal_parameters
f_opt = calibration.optimal_criterion
print("optimal penalty_level:", x_opt["penalty_level"][0])
print("optimal criterion:", f_opt)
    INFO - 16:59:13:
    INFO - 16:59:13: *** Start DOEScenario execution ***
    INFO - 16:59:13: DOEScenario
    INFO - 16:59:13:    Disciplines: MLAlgoAssessor
    INFO - 16:59:13:    MDO formulation: DisciplinaryOpt
    INFO - 16:59:13: Optimization problem:
    INFO - 16:59:13:    minimize criterion(penalty_level)
    INFO - 16:59:13:    with respect to penalty_level
    INFO - 16:59:13:    over the design space:
    INFO - 16:59:13:    +---------------+-------------+-------+-------------+-------+
    INFO - 16:59:13:    | name          | lower_bound | value | upper_bound | type  |
    INFO - 16:59:13:    +---------------+-------------+-------+-------------+-------+
    INFO - 16:59:13:    | penalty_level |      0      |   0   |     100     | float |
    INFO - 16:59:13:    +---------------+-------------+-------+-------------+-------+
    INFO - 16:59:13: Solving optimization problem with algorithm fullfact:
    INFO - 16:59:13: ...   0%|          | 0/10 [00:00<?, ?it]
    INFO - 16:59:13: ...  10%|█         | 1/10 [00:00<00:00, 194.53 it/sec, obj=1.63e+5]
    INFO - 16:59:13: ...  20%|██        | 2/10 [00:00<00:00, 253.12 it/sec, obj=3.25e+4]
    INFO - 16:59:13: ...  30%|███       | 3/10 [00:00<00:00, 280.52 it/sec, obj=1.78e+4]
    INFO - 16:59:13: ...  40%|████      | 4/10 [00:00<00:00, 301.61 it/sec, obj=1.72e+4]
    INFO - 16:59:13: ...  50%|█████     | 5/10 [00:00<00:00, 316.32 it/sec, obj=2e+4]
    INFO - 16:59:13: ...  60%|██████    | 6/10 [00:00<00:00, 323.07 it/sec, obj=2.35e+4]
    INFO - 16:59:13: ...  70%|███████   | 7/10 [00:00<00:00, 331.94 it/sec, obj=2.7e+4]
    INFO - 16:59:13: ...  80%|████████  | 8/10 [00:00<00:00, 337.69 it/sec, obj=3.03e+4]
    INFO - 16:59:13: ...  90%|█████████ | 9/10 [00:00<00:00, 340.22 it/sec, obj=3.33e+4]
    INFO - 16:59:13: ... 100%|██████████| 10/10 [00:00<00:00, 345.23 it/sec, obj=3.59e+4]
    INFO - 16:59:13: Optimization result:
    INFO - 16:59:13:    Optimizer info:
    INFO - 16:59:13:       Status: None
    INFO - 16:59:13:       Message: None
    INFO - 16:59:13:       Number of calls to the objective function by the optimizer: 10
    INFO - 16:59:13:    Solution:
    INFO - 16:59:13:       Objective: 17189.52649297338
    INFO - 16:59:13:       Design space:
    INFO - 16:59:13:       +---------------+-------------+-------------------+-------------+-------+
    INFO - 16:59:13:       | name          | lower_bound |       value       | upper_bound | type  |
    INFO - 16:59:13:       +---------------+-------------+-------------------+-------------+-------+
    INFO - 16:59:13:       | penalty_level |      0      | 33.33333333333333 |     100     | float |
    INFO - 16:59:13:       +---------------+-------------+-------------------+-------------+-------+
    INFO - 16:59:13: *** End DOEScenario execution (time: 0:00:00.037847) ***
optimal penalty_level: 33.33333333333333
optimal criterion: 17189.52649297338

Get the history

print(calibration.dataset.export_to_dataframe())
         inputs        outputs
  penalty_level      criterion      learning
              0              0             0
0      0.000000  162525.860760  8.767875e-23
1     11.111111   32506.221289  1.087801e+03
2     22.222222   17820.599507  1.982580e+03
3     33.333333   17189.526493  2.690007e+03
4     44.444444   19953.420378  3.251453e+03
5     55.555556   23493.269988  3.703714e+03
6     66.666667   27024.053276  4.074147e+03
7     77.777778   30303.486633  4.382362e+03
8     88.888889   33272.062305  4.642448e+03
9    100.000000   35934.745536  4.864667e+03

Visualize the results

penalty_level = calibration.get_history("penalty_level")
criterion = calibration.get_history("criterion")
learning = calibration.get_history("learning")

plt.plot(penalty_level, criterion, "-o", label="test", color="red")
plt.plot(penalty_level, learning, "-o", label="learning", color="blue")
plt.axvline(x_opt["penalty_level"], color="red", ls="--")
plt.xlabel("ridge penalty")
plt.ylabel("quality")
plt.legend()
plt.show()
plot calibration

Calibrate the lasso penalty of the polynomial regression

Define and execute the calibration

calibration_space = DesignSpace()
calibration_space.add_variable("penalty_level", 1, "float", 0.0, 100.0, 0.0)
calibration = MLAlgoCalibration(
    "PolynomialRegressor",
    dataset,
    ["penalty_level"],
    calibration_space,
    MSEMeasure,
    measure_options,
    degree=10,
    l2_penalty_ratio=0.0,
)
calibration.execute({"algo": "fullfact", "n_samples": 10})
x_opt = calibration.optimal_parameters
f_opt = calibration.optimal_criterion
print("optimal penalty_level:", x_opt["penalty_level"][0])
print("optimal criterion:", f_opt)
    INFO - 16:59:13:
    INFO - 16:59:13: *** Start DOEScenario execution ***
    INFO - 16:59:13: DOEScenario
    INFO - 16:59:13:    Disciplines: MLAlgoAssessor
    INFO - 16:59:13:    MDO formulation: DisciplinaryOpt
    INFO - 16:59:13: Optimization problem:
    INFO - 16:59:13:    minimize criterion(penalty_level)
    INFO - 16:59:13:    with respect to penalty_level
    INFO - 16:59:13:    over the design space:
    INFO - 16:59:13:    +---------------+-------------+-------+-------------+-------+
    INFO - 16:59:13:    | name          | lower_bound | value | upper_bound | type  |
    INFO - 16:59:13:    +---------------+-------------+-------+-------------+-------+
    INFO - 16:59:13:    | penalty_level |      0      |   0   |     100     | float |
    INFO - 16:59:13:    +---------------+-------------+-------+-------------+-------+
    INFO - 16:59:13: Solving optimization problem with algorithm fullfact:
    INFO - 16:59:13: ...   0%|          | 0/10 [00:00<?, ?it]
    INFO - 16:59:13: ...  10%|█         | 1/10 [00:00<00:00, 194.31 it/sec, obj=1.63e+5]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 5.301e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  20%|██        | 2/10 [00:00<00:00, 161.74 it/sec, obj=1.58e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 4.631e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  30%|███       | 3/10 [00:00<00:00, 160.99 it/sec, obj=3.15e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 2.284e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  40%|████      | 4/10 [00:00<00:00, 164.99 it/sec, obj=4.74e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 1.984e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  50%|█████     | 5/10 [00:00<00:00, 166.12 it/sec, obj=5.94e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 1.054e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  60%|██████    | 6/10 [00:00<00:00, 168.22 it/sec, obj=6.27e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 1.152e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  70%|███████   | 7/10 [00:00<00:00, 167.82 it/sec, obj=6.63e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 9.925e+03, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  80%|████████  | 8/10 [00:00<00:00, 169.21 it/sec, obj=6.93e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 8.746e+03, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  90%|█████████ | 9/10 [00:00<00:00, 169.81 it/sec, obj=7.25e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 6.372e+03, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ... 100%|██████████| 10/10 [00:00<00:00, 170.23 it/sec, obj=7.57e+4]
    INFO - 16:59:13: Optimization result:
    INFO - 16:59:13:    Optimizer info:
    INFO - 16:59:13:       Status: None
    INFO - 16:59:13:       Message: None
    INFO - 16:59:13:       Number of calls to the objective function by the optimizer: 10
    INFO - 16:59:13:    Solution:
    INFO - 16:59:13:       Objective: 15775.989581125898
    INFO - 16:59:13:       Design space:
    INFO - 16:59:13:       +---------------+-------------+-------------------+-------------+-------+
    INFO - 16:59:13:       | name          | lower_bound |       value       | upper_bound | type  |
    INFO - 16:59:13:       +---------------+-------------+-------------------+-------------+-------+
    INFO - 16:59:13:       | penalty_level |      0      | 11.11111111111111 |     100     | float |
    INFO - 16:59:13:       +---------------+-------------+-------------------+-------------+-------+
    INFO - 16:59:13: *** End DOEScenario execution (time: 0:00:00.067456) ***
optimal penalty_level: 11.11111111111111
optimal criterion: 15775.989581125898

Get the history

print(calibration.dataset.export_to_dataframe())
         inputs        outputs
  penalty_level      criterion      learning
              0              0             0
0      0.000000  162525.860760  8.767875e-23
1     11.111111   15775.989581  1.814382e+03
2     22.222222   31529.584354  4.057302e+03
3     33.333333   47420.249503  5.792299e+03
4     44.444444   59358.207437  7.169565e+03
5     55.555556   62656.171431  7.278397e+03
6     66.666667   66256.259889  7.410137e+03
7     77.777778   69336.190346  7.540731e+03
8     88.888889   72457.378777  7.675963e+03
9    100.000000   75749.793494  7.816545e+03

Visualize the results

penalty_level = calibration.get_history("penalty_level")
criterion = calibration.get_history("criterion")
learning = calibration.get_history("learning")

plt.plot(penalty_level, criterion, "-o", label="test", color="red")
plt.plot(penalty_level, learning, "-o", label="learning", color="blue")
plt.axvline(x_opt["penalty_level"], color="red", ls="--")
plt.xlabel("lasso penalty")
plt.ylabel("quality")
plt.legend()
plt.show()
plot calibration

Calibrate the elasticnet penalty of the polynomial regression

Define and execute the calibration

calibration_space = DesignSpace()
calibration_space.add_variable("penalty_level", 1, "float", 0.0, 40.0, 0.0)
calibration_space.add_variable("l2_penalty_ratio", 1, "float", 0.0, 1.0, 0.5)
calibration = MLAlgoCalibration(
    "PolynomialRegressor",
    dataset,
    ["penalty_level", "l2_penalty_ratio"],
    calibration_space,
    MSEMeasure,
    measure_options,
    degree=10,
)
calibration.execute({"algo": "fullfact", "n_samples": 100})
x_opt = calibration.optimal_parameters
f_opt = calibration.optimal_criterion
print("optimal penalty_level:", x_opt["penalty_level"][0])
print("optimal l2_penalty_ratio:", x_opt["l2_penalty_ratio"][0])
print("optimal criterion:", f_opt)
    INFO - 16:59:13:
    INFO - 16:59:13: *** Start DOEScenario execution ***
    INFO - 16:59:13: DOEScenario
    INFO - 16:59:13:    Disciplines: MLAlgoAssessor
    INFO - 16:59:13:    MDO formulation: DisciplinaryOpt
    INFO - 16:59:13: Optimization problem:
    INFO - 16:59:13:    minimize criterion(penalty_level, l2_penalty_ratio)
    INFO - 16:59:13:    with respect to l2_penalty_ratio, penalty_level
    INFO - 16:59:13:    over the design space:
    INFO - 16:59:13:    +------------------+-------------+-------+-------------+-------+
    INFO - 16:59:13:    | name             | lower_bound | value | upper_bound | type  |
    INFO - 16:59:13:    +------------------+-------------+-------+-------------+-------+
    INFO - 16:59:13:    | penalty_level    |      0      |   0   |      40     | float |
    INFO - 16:59:13:    | l2_penalty_ratio |      0      |  0.5  |      1      | float |
    INFO - 16:59:13:    +------------------+-------------+-------+-------------+-------+
    INFO - 16:59:13: Solving optimization problem with algorithm fullfact:
    INFO - 16:59:13: ...   0%|          | 0/100 [00:00<?, ?it]
    INFO - 16:59:13: ...   1%|          | 1/100 [00:00<00:00, 174.21 it/sec, obj=1.63e+5]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 2.904e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...   2%|▏         | 2/100 [00:00<00:00, 161.66 it/sec, obj=4.14e+3]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 1.786e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...   3%|▎         | 3/100 [00:00<00:00, 162.02 it/sec, obj=1.34e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 2.325e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...   4%|▍         | 4/100 [00:00<00:00, 162.46 it/sec, obj=1.79e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 4.034e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...   5%|▌         | 5/100 [00:00<00:00, 163.28 it/sec, obj=2.39e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 4.631e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...   6%|▌         | 6/100 [00:00<00:00, 164.00 it/sec, obj=3.15e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 4.166e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...   7%|▋         | 7/100 [00:00<00:00, 164.42 it/sec, obj=3.91e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 1.968e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...   8%|▊         | 8/100 [00:00<00:00, 165.28 it/sec, obj=4.5e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 2.545e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...   9%|▉         | 9/100 [00:00<00:00, 166.35 it/sec, obj=4.95e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 2.811e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  10%|█         | 10/100 [00:00<00:00, 166.43 it/sec, obj=5.42e+4]
    INFO - 16:59:13: ...  11%|█         | 11/100 [00:00<00:00, 173.72 it/sec, obj=1.63e+5]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 5.233e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  12%|█▏        | 12/100 [00:00<00:00, 171.89 it/sec, obj=1.35e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 6.032e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  13%|█▎        | 13/100 [00:00<00:00, 170.13 it/sec, obj=2.44e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 4.991e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  14%|█▍        | 14/100 [00:00<00:00, 169.12 it/sec, obj=3.28e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 5.326e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  15%|█▌        | 15/100 [00:00<00:00, 168.35 it/sec, obj=4.19e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 5.100e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  16%|█▌        | 16/100 [00:00<00:00, 167.30 it/sec, obj=4.76e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 4.636e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  17%|█▋        | 17/100 [00:00<00:00, 167.05 it/sec, obj=5.16e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 4.011e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  18%|█▊        | 18/100 [00:00<00:00, 166.29 it/sec, obj=5.52e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 4.376e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  19%|█▉        | 19/100 [00:00<00:00, 166.47 it/sec, obj=5.78e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 3.274e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  20%|██        | 20/100 [00:00<00:00, 166.49 it/sec, obj=5.98e+4]
    INFO - 16:59:13: ...  21%|██        | 21/100 [00:00<00:00, 170.24 it/sec, obj=1.63e+5]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 5.416e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  22%|██▏       | 22/100 [00:00<00:00, 169.26 it/sec, obj=1.97e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 7.049e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  23%|██▎       | 23/100 [00:00<00:00, 168.11 it/sec, obj=3.17e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 7.114e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  24%|██▍       | 24/100 [00:00<00:00, 167.62 it/sec, obj=4.02e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 6.879e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  25%|██▌       | 25/100 [00:00<00:00, 167.29 it/sec, obj=4.59e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 6.346e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  26%|██▌       | 26/100 [00:00<00:00, 166.36 it/sec, obj=4.97e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 5.139e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  27%|██▋       | 27/100 [00:00<00:00, 165.56 it/sec, obj=5.3e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 3.088e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  28%|██▊       | 28/100 [00:00<00:00, 165.06 it/sec, obj=5.6e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 2.614e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  29%|██▉       | 29/100 [00:00<00:00, 164.80 it/sec, obj=5.89e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 2.419e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  30%|███       | 30/100 [00:00<00:00, 165.00 it/sec, obj=6.18e+4]
    INFO - 16:59:13: ...  31%|███       | 31/100 [00:00<00:00, 167.49 it/sec, obj=1.63e+5]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 6.445e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  32%|███▏      | 32/100 [00:00<00:00, 166.78 it/sec, obj=2.43e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 7.489e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  33%|███▎      | 33/100 [00:00<00:00, 166.38 it/sec, obj=3.58e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 7.720e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  34%|███▍      | 34/100 [00:00<00:00, 166.01 it/sec, obj=4.29e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 7.355e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  35%|███▌      | 35/100 [00:00<00:00, 165.78 it/sec, obj=4.77e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 5.901e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  36%|███▌      | 36/100 [00:00<00:00, 165.70 it/sec, obj=5.12e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 4.912e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  37%|███▋      | 37/100 [00:00<00:00, 165.37 it/sec, obj=5.43e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 4.813e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  38%|███▊      | 38/100 [00:00<00:00, 165.34 it/sec, obj=5.74e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 4.575e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  39%|███▉      | 39/100 [00:00<00:00, 165.11 it/sec, obj=6.05e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 4.228e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  40%|████      | 40/100 [00:00<00:00, 165.03 it/sec, obj=6.35e+4]
    INFO - 16:59:13: ...  41%|████      | 41/100 [00:00<00:00, 167.04 it/sec, obj=1.63e+5]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 7.024e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  42%|████▏     | 42/100 [00:00<00:00, 166.50 it/sec, obj=2.75e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 8.011e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  43%|████▎     | 43/100 [00:00<00:00, 166.17 it/sec, obj=3.82e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 8.113e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  44%|████▍     | 44/100 [00:00<00:00, 165.85 it/sec, obj=4.42e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 7.519e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  45%|████▌     | 45/100 [00:00<00:00, 165.44 it/sec, obj=4.9e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 6.055e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  46%|████▌     | 46/100 [00:00<00:00, 165.33 it/sec, obj=5.28e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 6.144e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  47%|████▋     | 47/100 [00:00<00:00, 165.17 it/sec, obj=5.61e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 6.279e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  48%|████▊     | 48/100 [00:00<00:00, 165.12 it/sec, obj=5.93e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 6.108e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  49%|████▉     | 49/100 [00:00<00:00, 165.01 it/sec, obj=6.24e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 7.238e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  50%|█████     | 50/100 [00:00<00:00, 164.92 it/sec, obj=6.54e+4]
    INFO - 16:59:13: ...  51%|█████     | 51/100 [00:00<00:00, 166.55 it/sec, obj=1.63e+5]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 7.431e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  52%|█████▏    | 52/100 [00:00<00:00, 166.18 it/sec, obj=2.99e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 8.364e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  53%|█████▎    | 53/100 [00:00<00:00, 165.68 it/sec, obj=3.96e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 8.413e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  54%|█████▍    | 54/100 [00:00<00:00, 165.45 it/sec, obj=4.51e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 7.943e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  55%|█████▌    | 55/100 [00:00<00:00, 165.18 it/sec, obj=5e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 7.337e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  56%|█████▌    | 56/100 [00:00<00:00, 164.94 it/sec, obj=5.43e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 7.369e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  57%|█████▋    | 57/100 [00:00<00:00, 164.88 it/sec, obj=5.78e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 7.650e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  58%|█████▊    | 58/100 [00:00<00:00, 164.63 it/sec, obj=6.11e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 7.892e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  59%|█████▉    | 59/100 [00:00<00:00, 164.60 it/sec, obj=6.41e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 8.651e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  60%|██████    | 60/100 [00:00<00:00, 164.41 it/sec, obj=6.66e+4]
    INFO - 16:59:13: ...  61%|██████    | 61/100 [00:00<00:00, 165.58 it/sec, obj=1.63e+5]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 7.740e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  62%|██████▏   | 62/100 [00:00<00:00, 165.27 it/sec, obj=3.18e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 8.649e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  63%|██████▎   | 63/100 [00:00<00:00, 164.83 it/sec, obj=4.07e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 8.844e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  64%|██████▍   | 64/100 [00:00<00:00, 164.56 it/sec, obj=4.6e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 7.984e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  65%|██████▌   | 65/100 [00:00<00:00, 164.23 it/sec, obj=5.09e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 8.131e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  66%|██████▌   | 66/100 [00:00<00:00, 163.82 it/sec, obj=5.53e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 8.602e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  67%|██████▋   | 67/100 [00:00<00:00, 163.70 it/sec, obj=5.92e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 8.732e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  68%|██████▊   | 68/100 [00:00<00:00, 163.49 it/sec, obj=6.25e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 9.134e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:13: ...  69%|██████▉   | 69/100 [00:00<00:00, 163.18 it/sec, obj=6.52e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 8.496e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:14: ...  70%|███████   | 70/100 [00:00<00:00, 163.06 it/sec, obj=6.71e+4]
    INFO - 16:59:14: ...  71%|███████   | 71/100 [00:00<00:00, 164.08 it/sec, obj=1.63e+5]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 8.000e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:14: ...  72%|███████▏  | 72/100 [00:00<00:00, 163.78 it/sec, obj=3.32e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 8.897e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:14: ...  73%|███████▎  | 73/100 [00:00<00:00, 163.64 it/sec, obj=4.15e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 9.148e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:14: ...  74%|███████▍  | 74/100 [00:00<00:00, 163.18 it/sec, obj=4.69e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 8.706e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:14: ...  75%|███████▌  | 75/100 [00:00<00:00, 162.90 it/sec, obj=5.19e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 9.195e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:14: ...  76%|███████▌  | 76/100 [00:00<00:00, 162.70 it/sec, obj=5.63e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 9.466e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:14: ...  77%|███████▋  | 77/100 [00:00<00:00, 162.42 it/sec, obj=6.01e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 9.580e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:14: ...  78%|███████▊  | 78/100 [00:00<00:00, 162.22 it/sec, obj=6.32e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 9.258e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:14: ...  79%|███████▉  | 79/100 [00:00<00:00, 161.99 it/sec, obj=6.55e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 8.020e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:14: ...  80%|████████  | 80/100 [00:00<00:00, 161.69 it/sec, obj=6.72e+4]
    INFO - 16:59:14: ...  81%|████████  | 81/100 [00:00<00:00, 162.71 it/sec, obj=1.63e+5]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 8.222e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:14: ...  82%|████████▏ | 82/100 [00:00<00:00, 162.28 it/sec, obj=3.44e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 9.179e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:14: ...  83%|████████▎ | 83/100 [00:00<00:00, 162.06 it/sec, obj=4.23e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 9.446e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:14: ...  84%|████████▍ | 84/100 [00:00<00:00, 161.89 it/sec, obj=4.78e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 9.507e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:14: ...  85%|████████▌ | 85/100 [00:00<00:00, 161.58 it/sec, obj=5.3e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 9.936e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:14: ...  86%|████████▌ | 86/100 [00:00<00:00, 161.42 it/sec, obj=5.74e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 1.005e+05, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:14: ...  87%|████████▋ | 87/100 [00:00<00:00, 161.22 it/sec, obj=6.09e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 1.010e+05, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:14: ...  88%|████████▊ | 88/100 [00:00<00:00, 160.95 it/sec, obj=6.35e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 9.877e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:14: ...  89%|████████▉ | 89/100 [00:00<00:00, 160.85 it/sec, obj=6.53e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 9.866e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:14: ...  90%|█████████ | 90/100 [00:00<00:00, 160.63 it/sec, obj=6.67e+4]
    INFO - 16:59:14: ...  91%|█████████ | 91/100 [00:00<00:00, 161.48 it/sec, obj=1.63e+5]
    INFO - 16:59:14: ...  92%|█████████▏| 92/100 [00:00<00:00, 162.53 it/sec, obj=6.89e+4]
    INFO - 16:59:14: ...  93%|█████████▎| 93/100 [00:00<00:00, 163.50 it/sec, obj=4.03e+4]
    INFO - 16:59:14: ...  94%|█████████▍| 94/100 [00:00<00:00, 164.43 it/sec, obj=2.71e+4]
    INFO - 16:59:14: ...  95%|█████████▌| 95/100 [00:00<00:00, 165.47 it/sec, obj=2.07e+4]
    INFO - 16:59:14: ...  96%|█████████▌| 96/100 [00:00<00:00, 166.43 it/sec, obj=1.78e+4]
    INFO - 16:59:14: ...  97%|█████████▋| 97/100 [00:00<00:00, 167.35 it/sec, obj=1.68e+4]
    INFO - 16:59:14: ...  98%|█████████▊| 98/100 [00:00<00:00, 168.36 it/sec, obj=1.69e+4]
    INFO - 16:59:14: ...  99%|█████████▉| 99/100 [00:00<00:00, 169.29 it/sec, obj=1.76e+4]
    INFO - 16:59:14: ... 100%|██████████| 100/100 [00:00<00:00, 170.18 it/sec, obj=1.87e+4]
    INFO - 16:59:14: Optimization result:
    INFO - 16:59:14:    Optimizer info:
    INFO - 16:59:14:       Status: None
    INFO - 16:59:14:       Message: None
    INFO - 16:59:14:       Number of calls to the objective function by the optimizer: 100
    INFO - 16:59:14:    Solution:
    INFO - 16:59:14:       Objective: 4136.820826715568
    INFO - 16:59:14:       Design space:
    INFO - 16:59:14:       +------------------+-------------+-------------------+-------------+-------+
    INFO - 16:59:14:       | name             | lower_bound |       value       | upper_bound | type  |
    INFO - 16:59:14:       +------------------+-------------+-------------------+-------------+-------+
    INFO - 16:59:14:       | penalty_level    |      0      | 4.444444444444445 |      40     | float |
    INFO - 16:59:14:       | l2_penalty_ratio |      0      |         0         |      1      | float |
    INFO - 16:59:14:       +------------------+-------------+-------------------+-------------+-------+
    INFO - 16:59:14: *** End DOEScenario execution (time: 0:00:00.596983) ***
optimal penalty_level: 4.444444444444445
optimal l2_penalty_ratio: 0.0
optimal criterion: 4136.820826715568

Get the history

print(calibration.dataset.export_to_dataframe())
             inputs                      outputs
   l2_penalty_ratio penalty_level      criterion      learning
                  0             0              0             0
0               0.0      0.000000  162525.860760  8.767875e-23
1               0.0      4.444444    4136.820827  4.546714e+02
2               0.0      8.888889   13371.034446  1.375915e+03
3               0.0     13.333333   17860.819693  2.176736e+03
4               0.0     17.777778   23914.366014  3.005032e+03
..              ...           ...            ...           ...
95              1.0     22.222222   17820.599507  1.982580e+03
96              1.0     26.666667   16816.595592  2.285780e+03
97              1.0     31.111111   16894.821607  2.561538e+03
98              1.0     35.555556   17602.178769  2.812662e+03
99              1.0     40.000000   18674.751406  3.041823e+03

[100 rows x 4 columns]

Visualize the results

penalty_level = calibration.get_history("penalty_level").flatten()
l2_penalty_ratio = calibration.get_history("l2_penalty_ratio").flatten()
criterion = calibration.get_history("criterion").flatten()
learning = calibration.get_history("learning").flatten()

triang = Triangulation(penalty_level, l2_penalty_ratio)

fig = plt.figure()
ax = fig.add_subplot(1, 2, 1)
ax.tricontourf(triang, criterion, cmap="Purples")
ax.scatter(x_opt["penalty_level"][0], x_opt["l2_penalty_ratio"][0])
ax.set_xlabel("penalty level")
ax.set_ylabel("l2 penalty ratio")
ax.set_title("Test measure")
ax = fig.add_subplot(1, 2, 2)
ax.tricontourf(triang, learning, cmap="Purples")
ax.scatter(x_opt["penalty_level"][0], x_opt["l2_penalty_ratio"][0])
ax.set_xlabel("penalty level")
ax.set_ylabel("l2 penalty ratio")
ax.set_title("Learning measure")

plt.show()
Test measure, Learning measure

Add an optimization stage

calibration_space = DesignSpace()
calibration_space.add_variable("penalty_level", 1, "float", 0.0, 40.0, 0.0)
calibration_space.add_variable("l2_penalty_ratio", 1, "float", 0.0, 1.0, 0.5)
calibration = MLAlgoCalibration(
    "PolynomialRegressor",
    dataset,
    ["penalty_level", "l2_penalty_ratio"],
    calibration_space,
    MSEMeasure,
    measure_options,
    degree=10,
)
calibration.execute({"algo": "NLOPT_COBYLA", "max_iter": 100})
x_opt2 = calibration.optimal_parameters
f_opt2 = calibration.optimal_criterion

fig = plt.figure()
ax = fig.add_subplot(1, 2, 1)
ax.tricontourf(triang, criterion, cmap="Purples")
ax.scatter(x_opt["penalty_level"][0], x_opt["l2_penalty_ratio"][0])
ax.scatter(x_opt2["penalty_level"][0], x_opt2["l2_penalty_ratio"][0], color="red")
ax.set_xlabel("penalty level")
ax.set_ylabel("l2 penalty ratio")
ax.set_title("Test measure")
ax = fig.add_subplot(1, 2, 2)
ax.tricontourf(triang, learning, cmap="Purples")
ax.scatter(x_opt["penalty_level"][0], x_opt["l2_penalty_ratio"][0])
ax.scatter(x_opt2["penalty_level"][0], x_opt2["l2_penalty_ratio"][0], color="red")
ax.set_xlabel("penalty level")
ax.set_ylabel("l2 penalty ratio")
ax.set_title("Learning measure")
plt.show()

n_iterations = len(calibration.scenario.disciplines[0].cache)
print(f"MSE with DOE: {f_opt} (100 evaluations)")
print(f"MSE with OPT: {f_opt2} ({n_iterations} evaluations)")
print(f"MSE reduction:{round((f_opt2 - f_opt) / f_opt * 100)}%")
Test measure, Learning measure
    INFO - 16:59:14:
    INFO - 16:59:14: *** Start MDOScenario execution ***
    INFO - 16:59:14: MDOScenario
    INFO - 16:59:14:    Disciplines: MLAlgoAssessor
    INFO - 16:59:14:    MDO formulation: DisciplinaryOpt
    INFO - 16:59:14: Optimization problem:
    INFO - 16:59:14:    minimize criterion(penalty_level, l2_penalty_ratio)
    INFO - 16:59:14:    with respect to l2_penalty_ratio, penalty_level
    INFO - 16:59:14:    over the design space:
    INFO - 16:59:14:    +------------------+-------------+-------+-------------+-------+
    INFO - 16:59:14:    | name             | lower_bound | value | upper_bound | type  |
    INFO - 16:59:14:    +------------------+-------------+-------+-------------+-------+
    INFO - 16:59:14:    | penalty_level    |      0      |   0   |      40     | float |
    INFO - 16:59:14:    | l2_penalty_ratio |      0      |  0.5  |      1      | float |
    INFO - 16:59:14:    +------------------+-------------+-------+-------------+-------+
    INFO - 16:59:14: Solving optimization problem with algorithm NLOPT_COBYLA:
    INFO - 16:59:14: ...   0%|          | 0/100 [00:00<?, ?it]
    INFO - 16:59:14: ...   1%|          | 1/100 [00:00<00:00, 171.04 it/sec, obj=1.63e+5]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 8.287e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:14: ...   2%|▏         | 2/100 [00:00<00:00, 156.31 it/sec, obj=4.06e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 8.952e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:14: ...   3%|▎         | 3/100 [00:00<00:00, 144.93 it/sec, obj=4.28e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 7.118e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:14: ...   4%|▍         | 4/100 [00:00<00:00, 145.44 it/sec, obj=5.16e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 8.089e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:14: ...   5%|▌         | 5/100 [00:00<00:00, 143.98 it/sec, obj=4.66e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 7.973e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:14: ...   6%|▌         | 6/100 [00:00<00:00, 142.61 it/sec, obj=3.63e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 7.402e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:14: ...   7%|▋         | 7/100 [00:00<00:00, 142.02 it/sec, obj=3.03e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 6.059e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:14: ...   8%|▊         | 8/100 [00:00<00:00, 142.00 it/sec, obj=2.03e+4]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 1.428e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:14: ...   9%|▉         | 9/100 [00:00<00:00, 141.26 it/sec, obj=2.75e+3]
    INFO - 16:59:14: ...  10%|█         | 10/100 [00:00<00:00, 144.92 it/sec, obj=493]
    INFO - 16:59:14: ...  11%|█         | 11/100 [00:00<00:00, 151.69 it/sec, obj=1.63e+5]
    INFO - 16:59:14: ...  12%|█▏        | 12/100 [00:00<00:00, 157.91 it/sec, obj=1.63e+5]
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.3.0.post0/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 2.976e+04, tolerance: 2.850e+03
  model = cd_fast.enet_coordinate_descent(
    INFO - 16:59:14: ...  13%|█▎        | 13/100 [00:00<00:00, 155.82 it/sec, obj=5.23e+3]
    INFO - 16:59:14: ...  14%|█▍        | 14/100 [00:00<00:00, 157.88 it/sec, obj=493]
    INFO - 16:59:14: ...  15%|█▌        | 15/100 [00:00<00:00, 159.72 it/sec, obj=493]
    INFO - 16:59:14: ...  16%|█▌        | 16/100 [00:00<00:00, 161.59 it/sec, obj=493]
    INFO - 16:59:14: Optimization result:
    INFO - 16:59:14:    Optimizer info:
    INFO - 16:59:14:       Status: None
    INFO - 16:59:14:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
    INFO - 16:59:14:       Number of calls to the objective function by the optimizer: 17
    INFO - 16:59:14:    Solution:
    INFO - 16:59:14:       Objective: 493.1818200496802
    INFO - 16:59:14:       Design space:
    INFO - 16:59:14:       +------------------+-------------+-----------------------+-------------+-------+
    INFO - 16:59:14:       | name             | lower_bound |         value         | upper_bound | type  |
    INFO - 16:59:14:       +------------------+-------------+-----------------------+-------------+-------+
    INFO - 16:59:14:       | penalty_level    |      0      | 2.289834988289385e-15 |      40     | float |
    INFO - 16:59:14:       | l2_penalty_ratio |      0      |   0.5765298371174132  |      1      | float |
    INFO - 16:59:14:       +------------------+-------------+-----------------------+-------------+-------+
    INFO - 16:59:14: *** End MDOScenario execution (time: 0:00:00.111277) ***
MSE with DOE: 4136.820826715568 (100 evaluations)
MSE with OPT: 493.1818200496802 (2 evaluations)
MSE reduction:-88%

Total running time of the script: ( 0 minutes 1.717 seconds)

Gallery generated by Sphinx-Gallery