Skip to content

Commit

Permalink
FEA ridge benchmarks (#18)
Browse files Browse the repository at this point in the history
Add benchmarks for Ridge.

---------

Co-authored-by: Olivier Grisel <[email protected]>
  • Loading branch information
fcharras and ogrisel authored Feb 21, 2024
1 parent 6101c27 commit bd405f0
Show file tree
Hide file tree
Showing 18 changed files with 1,500 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ jobs:
run: |
python ./benchmarks/kmeans/consolidate_result_csv.py ./benchmarks/kmeans/results.csv --check-csv
python ./benchmarks/pca/consolidate_result_csv.py ./benchmarks/pca/results.csv --check-csv
python ./benchmarks/ridge/consolidate_result_csv.py ./benchmarks/ridge/results.csv --check-csv
3 changes: 3 additions & 0 deletions .github/workflows/sync_benchmark_files_to_gsheet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ jobs:
run: |
python ./benchmarks/kmeans/consolidate_result_csv.py ./benchmarks/kmeans/results.csv --check-csv
python ./benchmarks/pca/consolidate_result_csv.py ./benchmarks/pca/results.csv --check-csv
python ./benchmarks/ridge/consolidate_result_csv.py ./benchmarks/ridge/results.csv --check-csv
echo "$GSPREAD_SERVICE_ACCOUNT_AUTH_KEY" > service_account.json
python ./benchmarks/kmeans/consolidate_result_csv.py ./benchmarks/kmeans/results.csv \
--sync-to-gspread --gspread-url $GSPREAD_URL --gspread-auth-key ./service_account.json
python ./benchmarks/pca/consolidate_result_csv.py ./benchmarks/pca/results.csv \
--sync-to-gspread --gspread-url $GSPREAD_URL --gspread-auth-key ./service_account.json
python ./benchmarks/ridge/consolidate_result_csv.py ./benchmarks/ridge/results.csv \
--sync-to-gspread --gspread-url $GSPREAD_URL --gspread-auth-key ./service_account.json
2 changes: 2 additions & 0 deletions .github/workflows/test_cpu_benchmarks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,5 @@ jobs:
PYTHONPATH=$PYTHONPATH:$(realpath ../../kmeans_dpcpp/) benchopt run --no-plot -l -d Simulated_correlated_data[n_samples=1000,n_features=14]
cd ../pca
benchopt run --no-plot -l -d Simulated_correlated_data[n_samples=100,n_features=100]
cd ../ridge
benchopt run --no-plot -l -d Simulated_correlated_data[n_samples=100,n_features=100,n_targets=2]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ hardware.
Benchmarks are currently available for the following algorithms:
- [k-means](https://github.com/soda-inria/sklearn-engine-benchmarks/tree/main/benchmarks/kmeans)
- [PCA](https://github.com/soda-inria/sklearn-engine-benchmarks/tree/main/benchmarks/pca)
- [Ridge](https://github.com/soda-inria/sklearn-engine-benchmarks/tree/main/benchmarks/pca)

Here is a (non-exhaustive) list of libraries that are compared in the benchmarks:
- [scikit-learn](https://scikit-learn.org/stable/index.html)
Expand Down
10 changes: 5 additions & 5 deletions benchmarks/kmeans/consolidate_result_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from functools import partial
from io import BytesIO
from itertools import zip_longest
from operator import attrgetter

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -393,17 +392,18 @@ def _gspread_sync(source, gspread_url, gspread_auth_key):
worksheet.freeze(0, 0)
worksheet.resize(rows=n_rows + 1, cols=n_cols)
worksheet.clear_notes(global_range)
white_background = dict(
backgroundColorStyle=dict(rgbColor=dict(red=1, green=1, blue=1, alpha=1))
reset_format = dict(
backgroundColorStyle=dict(rgbColor=dict(red=1, green=1, blue=1, alpha=1)),
textFormat=dict(bold=False),
)
worksheet.format(global_range, white_background)
worksheet.format(global_range, reset_format)
except gspread.WorksheetNotFound:
worksheet = sheet.add_worksheet(
GOOGLE_WORKSHEET_NAME, rows=n_rows + 1, cols=n_cols
)
# ensure worksheets are sorted anti-alphabetically
sheet.reorder_worksheets(
sorted(sheet.worksheets(), key=attrgetter("title"), reverse=True)
sorted(sheet.worksheets(), key=lambda worksheet: worksheet.title.lower())
)

# upload all values
Expand Down
10 changes: 5 additions & 5 deletions benchmarks/pca/consolidate_result_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from functools import partial
from io import BytesIO
from itertools import zip_longest
from operator import attrgetter

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -391,17 +390,18 @@ def _gspread_sync(source, gspread_url, gspread_auth_key):
worksheet.freeze(0, 0)
worksheet.resize(rows=n_rows + 1, cols=n_cols)
worksheet.clear_notes(global_range)
white_background = dict(
backgroundColorStyle=dict(rgbColor=dict(red=1, green=1, blue=1, alpha=1))
reset_format = dict(
backgroundColorStyle=dict(rgbColor=dict(red=1, green=1, blue=1, alpha=1)),
textFormat=dict(bold=False),
)
worksheet.format(global_range, white_background)
worksheet.format(global_range, reset_format)
except gspread.WorksheetNotFound:
worksheet = sheet.add_worksheet(
GOOGLE_WORKSHEET_NAME, rows=n_rows + 1, cols=n_cols
)
# ensure worksheets are sorted anti-alphabetically
sheet.reorder_worksheets(
sorted(sheet.worksheets(), key=attrgetter("title"), reverse=True)
sorted(sheet.worksheets(), key=lambda worksheet: worksheet.title.lower())
)

# upload all values
Expand Down
Loading

0 comments on commit bd405f0

Please sign in to comment.