Skip to content

Commit bd405f0

Browse files
fcharrasogrisel
andauthored
FEA ridge benchmarks (#18)
Add benchmarks for Ridge. --------- Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
1 parent 6101c27 commit bd405f0

18 files changed

+1500
-10
lines changed

.github/workflows/run_benchmark_results_file_sanity_checks.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ jobs:
1919
run: |
2020
python ./benchmarks/kmeans/consolidate_result_csv.py ./benchmarks/kmeans/results.csv --check-csv
2121
python ./benchmarks/pca/consolidate_result_csv.py ./benchmarks/pca/results.csv --check-csv
22+
python ./benchmarks/ridge/consolidate_result_csv.py ./benchmarks/ridge/results.csv --check-csv

.github/workflows/sync_benchmark_files_to_gsheet.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ jobs:
2424
run: |
2525
python ./benchmarks/kmeans/consolidate_result_csv.py ./benchmarks/kmeans/results.csv --check-csv
2626
python ./benchmarks/pca/consolidate_result_csv.py ./benchmarks/pca/results.csv --check-csv
27+
python ./benchmarks/ridge/consolidate_result_csv.py ./benchmarks/ridge/results.csv --check-csv
2728
echo "$GSPREAD_SERVICE_ACCOUNT_AUTH_KEY" > service_account.json
2829
python ./benchmarks/kmeans/consolidate_result_csv.py ./benchmarks/kmeans/results.csv \
2930
--sync-to-gspread --gspread-url $GSPREAD_URL --gspread-auth-key ./service_account.json
3031
python ./benchmarks/pca/consolidate_result_csv.py ./benchmarks/pca/results.csv \
3132
--sync-to-gspread --gspread-url $GSPREAD_URL --gspread-auth-key ./service_account.json
33+
python ./benchmarks/ridge/consolidate_result_csv.py ./benchmarks/ridge/results.csv \
34+
--sync-to-gspread --gspread-url $GSPREAD_URL --gspread-auth-key ./service_account.json

.github/workflows/test_cpu_benchmarks.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,5 @@ jobs:
143143
PYTHONPATH=$PYTHONPATH:$(realpath ../../kmeans_dpcpp/) benchopt run --no-plot -l -d Simulated_correlated_data[n_samples=1000,n_features=14]
144144
cd ../pca
145145
benchopt run --no-plot -l -d Simulated_correlated_data[n_samples=100,n_features=100]
146+
cd ../ridge
147+
benchopt run --no-plot -l -d Simulated_correlated_data[n_samples=100,n_features=100,n_targets=2]

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ hardware.
1818
Benchmarks are currently available for the following algorithms:
1919
- [k-means](https://github.com/soda-inria/sklearn-engine-benchmarks/tree/main/benchmarks/kmeans)
2020
- [PCA](https://github.com/soda-inria/sklearn-engine-benchmarks/tree/main/benchmarks/pca)
21+
- [Ridge](https://github.com/soda-inria/sklearn-engine-benchmarks/tree/main/benchmarks/pca)
2122

2223
Here is a (non-exhaustive) list of libraries that are compared in the benchmarks:
2324
- [scikit-learn](https://scikit-learn.org/stable/index.html)

benchmarks/kmeans/consolidate_result_csv.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from functools import partial
33
from io import BytesIO
44
from itertools import zip_longest
5-
from operator import attrgetter
65

76
import numpy as np
87
import pandas as pd
@@ -393,17 +392,18 @@ def _gspread_sync(source, gspread_url, gspread_auth_key):
393392
worksheet.freeze(0, 0)
394393
worksheet.resize(rows=n_rows + 1, cols=n_cols)
395394
worksheet.clear_notes(global_range)
396-
white_background = dict(
397-
backgroundColorStyle=dict(rgbColor=dict(red=1, green=1, blue=1, alpha=1))
395+
reset_format = dict(
396+
backgroundColorStyle=dict(rgbColor=dict(red=1, green=1, blue=1, alpha=1)),
397+
textFormat=dict(bold=False),
398398
)
399-
worksheet.format(global_range, white_background)
399+
worksheet.format(global_range, reset_format)
400400
except gspread.WorksheetNotFound:
401401
worksheet = sheet.add_worksheet(
402402
GOOGLE_WORKSHEET_NAME, rows=n_rows + 1, cols=n_cols
403403
)
404404
# ensure worksheets are sorted anti-alphabetically
405405
sheet.reorder_worksheets(
406-
sorted(sheet.worksheets(), key=attrgetter("title"), reverse=True)
406+
sorted(sheet.worksheets(), key=lambda worksheet: worksheet.title.lower())
407407
)
408408

409409
# upload all values

benchmarks/pca/consolidate_result_csv.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from functools import partial
33
from io import BytesIO
44
from itertools import zip_longest
5-
from operator import attrgetter
65

76
import numpy as np
87
import pandas as pd
@@ -391,17 +390,18 @@ def _gspread_sync(source, gspread_url, gspread_auth_key):
391390
worksheet.freeze(0, 0)
392391
worksheet.resize(rows=n_rows + 1, cols=n_cols)
393392
worksheet.clear_notes(global_range)
394-
white_background = dict(
395-
backgroundColorStyle=dict(rgbColor=dict(red=1, green=1, blue=1, alpha=1))
393+
reset_format = dict(
394+
backgroundColorStyle=dict(rgbColor=dict(red=1, green=1, blue=1, alpha=1)),
395+
textFormat=dict(bold=False),
396396
)
397-
worksheet.format(global_range, white_background)
397+
worksheet.format(global_range, reset_format)
398398
except gspread.WorksheetNotFound:
399399
worksheet = sheet.add_worksheet(
400400
GOOGLE_WORKSHEET_NAME, rows=n_rows + 1, cols=n_cols
401401
)
402402
# ensure worksheets are sorted anti-alphabetically
403403
sheet.reorder_worksheets(
404-
sorted(sheet.worksheets(), key=attrgetter("title"), reverse=True)
404+
sorted(sheet.worksheets(), key=lambda worksheet: worksheet.title.lower())
405405
)
406406

407407
# upload all values

0 commit comments

Comments
 (0)