Skip to content

Commit

Permalink
clarify where optimization results are stored (#525)
Browse files Browse the repository at this point in the history
  • Loading branch information
aloctavodia authored Aug 17, 2024
1 parent 041ee09 commit 49e3c82
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 38 deletions.
38 changes: 0 additions & 38 deletions docs/examples/param_space_1d_examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -569,44 +569,6 @@
"dist.alpha, dist.beta"
]
},
{
"cell_type": "markdown",
"id": "ed0c9037",
"metadata": {},
"source": [
"`maxent` (and other optimization functions we will see later) returns and [OptimizeResult](https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.OptimizeResult.html#scipy.optimize.OptimizeResult) that users can inspect if they need more information of the result of the optimization routine."
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "6cf499b5",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
" message: Optimization terminated successfully\n",
" success: True\n",
" status: 0\n",
" fun: -1.4244960108798204\n",
" x: [-1.330e-08 1.006e+00]\n",
" nit: 4\n",
" jac: [ 0.000e+00 -9.945e-01]\n",
" nfev: 12\n",
" njev: 4"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"_, opt = pz.maxent(pz.Normal(), -1, 1, 0.68, plot=False)\n",
"opt"
]
},
{
"cell_type": "markdown",
"id": "f8500fef",
Expand Down
5 changes: 5 additions & 0 deletions preliz/unidimensional/maxent.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ def maxent(
dict: dict with the parameters of the distribution
axes: matplotlib axes (only if `plot=True`)
Notes
-----
After calling this function the attribute `opt` of the distribution will be updated with the
OptimizeResult object from the optimization step.
See Also
--------
quartile : Find the distribution with the specified quartiles.
Expand Down
5 changes: 5 additions & 0 deletions preliz/unidimensional/quartile.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ def quartile(
dict: dict with the parameters of the distribution
axes: matplotlib axes (only if `plot=True`)
Notes
-----
After calling this function the attribute `opt` of the distribution will be updated with the
OptimizeResult object from the optimization step.
See Also
--------
maxent : Find the maximum entropy distribution with a given mass inside a user defined interval.
Expand Down

0 comments on commit 49e3c82

Please sign in to comment.