Skip to content

Commit 883304e

Browse files
committed
DOC smooth speed plot
1 parent a5bd1b2 commit 883304e

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

.github/workflows/emscripten.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
steps:
1010
- uses: actions/checkout@v4
1111
- name: Build WASM wheel
12-
uses: pypa/[email protected].2
12+
uses: pypa/[email protected].3
1313
env:
1414
CIBW_PLATFORM: pyodide
1515
- name: Upload package

.github/workflows/wheel.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
steps:
3434
- uses: actions/checkout@v4
3535
- name: Build wheels
36-
uses: pypa/[email protected].2
36+
uses: pypa/[email protected].3
3737
env:
3838
CIBW_SKIP: "*_i686 *_ppc64le *_s390x *_universal2 *-musllinux_* cp314*"
3939
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.10"

examples/plot_speed.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,19 +174,25 @@ def baseline(X, y, t):
174174

175175
n_features_max = 30
176176

177+
from timeit import repeat
178+
177179
time_h = np.zeros(n_features_max, dtype=float)
178180
time_eta = np.zeros(n_features_max, dtype=float)
179181
for i in range(n_features_max):
180-
time_h[i] = timeit(
182+
times_h = repeat(
181183
f"s = FastCan({i + 1}, verbose=0).fit(X, y)",
182-
number=10,
184+
number=1,
185+
repeat=10,
183186
globals=globals(),
184187
)
185-
time_eta[i] = timeit(
188+
time_h[i] = np.median(times_h)
189+
times_eta = repeat(
186190
f"s = FastCan({i + 1}, eta=True, verbose=0).fit(X, y)",
187-
number=10,
191+
number=1,
192+
repeat=10,
188193
globals=globals(),
189194
)
195+
time_eta[i] = np.median(times_eta)
190196

191197
feature_num = np.arange(n_features_max, dtype=int) + 1
192198
plt.plot(feature_num, time_h, label="h-correlation")

0 commit comments

Comments
 (0)