Skip to content

Commit 2597051

Browse files
author
Circle CI
committed
Update docs for dev (build 3999)
1 parent 9734858 commit 2597051

240 files changed

Lines changed: 10140 additions & 7729 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

dev/.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: d0bb3e61215340052b6b83f7c53f4cfe
3+
config: faf4775a86fa92dc2678830c5729b41f
44
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file not shown.

dev/_downloads/46d3545d2de3fcee6756b7d2ee7fb39f/plot_run_benchmark_python_R.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
f"{BENCHMARK_PATH.resolve()}"
2424
)
2525

26-
_, save_file = run_benchmark(
26+
save_file = run_benchmark(
2727
BENCHMARK_PATH,
2828
solver_names=['Python-PGD[use_acceleration=False]', 'R-PGD'],
2929
dataset_names=["Simulated[n_features=5000,n_samples=100,rho=0]"],
Binary file not shown.
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Running an existing benchmark\n\nThis Example demonstrates how to run an existing benchmark with benchopt.\nIt uses the `benchopt_run` helper function to run the benchmark, which runs\nprogrammatically the equivalent of the command line interface:\n"
8+
]
9+
},
10+
{
11+
"cell_type": "code",
12+
"execution_count": null,
13+
"metadata": {
14+
"collapsed": false
15+
},
16+
"outputs": [],
17+
"source": [
18+
"from benchopt.helpers.run_examples import benchopt_run"
19+
]
20+
},
21+
{
22+
"cell_type": "markdown",
23+
"metadata": {},
24+
"source": [
25+
"To run the benchmark, just execute:\n\n\n"
26+
]
27+
},
28+
{
29+
"cell_type": "code",
30+
"execution_count": null,
31+
"metadata": {
32+
"collapsed": false
33+
},
34+
"outputs": [],
35+
"source": [
36+
"benchopt_run('minimal_benchmark', n=20, r=2)"
37+
]
38+
},
39+
{
40+
"cell_type": "markdown",
41+
"metadata": {},
42+
"source": [
43+
"This runs the benchmark named ``minimal_benchmark`` located in the\n``examples`` folder.\n\nThe parameters ``n`` controls the number of point on the curves, while ``r``\ncontrols the number of repetitions for each solver. The repetitions are used\nto compute the median and quartiles of the curves.\n\nTo get a more precise curve, you can increase ``n`` and ``r``:\n\n"
44+
]
45+
},
46+
{
47+
"cell_type": "code",
48+
"execution_count": null,
49+
"metadata": {
50+
"collapsed": false
51+
},
52+
"outputs": [],
53+
"source": [
54+
"benchopt_run('minimal_benchmark', n=30, r=5)"
55+
]
56+
},
57+
{
58+
"cell_type": "markdown",
59+
"metadata": {},
60+
"source": [
61+
"Here, the display is not ideal because both solvers reach convergence very\nquickly. You can change the display by selecting the scale of the axis in\nthe plot configuration panel.\nGo to the *Change plot* banner at the top of the HTML file, and change the\nscale to ``loglog`` on the drop down menu.\n\nNote that for convenience, this can be saved as a view in the configuration\nof the benchmark. See `here <plot_configs>` for more details.\nHere, clicking on ``Subopt. (log)`` in the *Available plots* above the\nfigure will take you to a view with the right scale, and looking at\nsuboptimality instead of objective value.\n\n"
62+
]
63+
}
64+
],
65+
"metadata": {
66+
"kernelspec": {
67+
"display_name": "Python 3",
68+
"language": "python",
69+
"name": "python3"
70+
},
71+
"language_info": {
72+
"codemirror_mode": {
73+
"name": "ipython",
74+
"version": 3
75+
},
76+
"file_extension": ".py",
77+
"mimetype": "text/x-python",
78+
"name": "python",
79+
"nbconvert_exporter": "python",
80+
"pygments_lexer": "ipython3",
81+
"version": "3.12.12"
82+
}
83+
},
84+
"nbformat": 4,
85+
"nbformat_minor": 0
86+
}
Binary file not shown.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
"""Running an existing benchmark
2+
=============================
3+
4+
This Example demonstrates how to run an existing benchmark with benchopt.
5+
It uses the `benchopt_run` helper function to run the benchmark, which runs
6+
programmatically the equivalent of the command line interface:
7+
"""
8+
9+
from benchopt.helpers.run_examples import benchopt_run
10+
11+
# %%
12+
# To run the benchmark, just execute:
13+
#
14+
15+
benchopt_run('minimal_benchmark', n=20, r=2)
16+
17+
# %%
18+
# This runs the benchmark named ``minimal_benchmark`` located in the
19+
# ``examples`` folder.
20+
#
21+
# The parameters ``n`` controls the number of point on the curves, while ``r``
22+
# controls the number of repetitions for each solver. The repetitions are used
23+
# to compute the median and quartiles of the curves.
24+
#
25+
# To get a more precise curve, you can increase ``n`` and ``r``:
26+
27+
benchopt_run('minimal_benchmark', n=30, r=5)
28+
29+
# %%
30+
# Here, the display is not ideal because both solvers reach convergence very
31+
# quickly. You can change the display by selecting the scale of the axis in
32+
# the plot configuration panel.
33+
# Go to the *Change plot* banner at the top of the HTML file, and change the
34+
# scale to ``loglog`` on the drop down menu.
35+
#
36+
# Note that for convenience, this can be saved as a view in the configuration
37+
# of the benchmark. See :ref:`here <plot_configs>` for more details.
38+
# Here, clicking on ``Subopt. (log)`` in the *Available plots* above the
39+
# figure will take you to a view with the right scale, and looking at
40+
# suboptimality instead of objective value.
Binary file not shown.
Binary file not shown.

dev/_downloads/cdb26c80ea62f96a318a8bcdbbf34171/plot_run_benchmark.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"outputs": [],
1717
"source": [
18-
"from pathlib import Path\nimport matplotlib.pyplot as plt\nfrom benchopt import run_benchmark\nfrom benchopt.benchmark import Benchmark\nfrom benchopt.plotting import plot_benchmark\nfrom benchopt.plotting.helpers import reset_solver_styles\n\n\nBENCHMARK_PATH = (\n Path().resolve().parent / 'benchmarks' / 'benchmark_logreg_l2'\n)\n\ntry:\n\n _, save_file = run_benchmark(\n BENCHMARK_PATH,\n solver_names=['sklearn[liblinear]', 'sklearn[newton-cg]', 'lightning'],\n dataset_names=[\"Simulated[n_features=500,n_samples=200]\"],\n objective_filters=['L2 Logistic Regression[lmbd=1.0]'],\n max_runs=100, timeout=20, n_repetitions=15,\n plot_result=False, show_progress=True\n )\n\nexcept RuntimeError:\n raise RuntimeError(\n \"This example can only work when Logreg-l2 benchmark is cloned in a \"\n \"`benchmarks` folder. Please run:\\n\"\n \"$ git clone https://github.com/benchopt/benchmark_logreg_l2 \"\n f\"{BENCHMARK_PATH.resolve()}\"\n )\n\nreset_solver_styles()\n\nfigs = plot_benchmark(\n save_file, benchmark=Benchmark(BENCHMARK_PATH), html=False\n)\nplt.show()"
18+
"from pathlib import Path\nimport matplotlib.pyplot as plt\nfrom benchopt import run_benchmark\nfrom benchopt.benchmark import Benchmark\nfrom benchopt.plotting import plot_benchmark\nfrom benchopt.plotting.helpers import reset_solver_styles\n\n\nBENCHMARK_PATH = (\n Path().resolve().parent / 'benchmarks' / 'benchmark_logreg_l2'\n)\n\ntry:\n\n save_file = run_benchmark(\n BENCHMARK_PATH,\n solver_names=['sklearn[liblinear]', 'sklearn[newton-cg]', 'lightning'],\n dataset_names=[\"Simulated[n_features=500,n_samples=200]\"],\n objective_filters=['L2 Logistic Regression[lmbd=1.0]'],\n max_runs=100, timeout=20, n_repetitions=15,\n plot_result=False, show_progress=True\n )\n\nexcept RuntimeError:\n raise RuntimeError(\n \"This example can only work when Logreg-l2 benchmark is cloned in a \"\n \"`benchmarks` folder. Please run:\\n\"\n \"$ git clone https://github.com/benchopt/benchmark_logreg_l2 \"\n f\"{BENCHMARK_PATH.resolve()}\"\n )\n\nreset_solver_styles()\n\nfigs = plot_benchmark(\n save_file, benchmark=Benchmark(BENCHMARK_PATH), html=False\n)\nplt.show()"
1919
]
2020
}
2121
],

0 commit comments

Comments
 (0)