Skip to content

Commit

Permalink
finish the MCO section (examples.rst)
Browse files Browse the repository at this point in the history
  • Loading branch information
alvls committed Nov 1, 2024
1 parent f594fc3 commit 6109a69
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions docs/source/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1979,10 +1979,16 @@ Let's consider the precision and recall metrics as the criteria to be optimized.
for fvar, fval in zip(var, val):
print(fvar, fval)
# Plot the Pareto set z[0]-z[1]
fv1 = [-trial.function_values[0].value for trial in sol.best_trials]
fv2 = [-trial.function_values[1].value for trial in sol.best_trials]
plt.plot(fv1, fv2, 'ro')
plt.show()
At the end of the execution of the program presented in the previous listing, we obtain the Pareto set:
[0.9107572752988098, 0.9831768388106417]
[0.9592640468256907, 0.980399061032864]
[0.9647457731704308, 0.9747261345852894]
[0.967120202394175, 0.9719483568075118]
[0.9647147147147146, 0.9747652582159624]
[0.9695575278152937, 0.957942097026604]

0 comments on commit 6109a69

Please sign in to comment.