Skip to content

ENH: Add incremental algorithms support #160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix num_batches and batch_size reading from config
  • Loading branch information
olegkkruglov committed Oct 4, 2024
commit f275062098635b049f2ff822c524c44f7b62422a
6 changes: 1 addition & 5 deletions configs/sklearnex_incremental_example.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@
}
},
"TEMPLATES": {
"covariance": {"SETS": ["common", "covariance", "unlabeled dataset"]},
"linear_regression": {
"SETS": ["common", "linear_regression", "labeled dataset"]
},
"pca": {"SETS": ["common", "pca", "unlabeled dataset"]}
"covariance": {"SETS": ["common", "covariance", "unlabeled dataset"]}
}
}
8 changes: 6 additions & 2 deletions sklbench/benchmarks/sklearn_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,12 @@ def measure_sklearn_estimator(
data_args = (x_test,)

if method == "partial_fit":
num_batches = get_bench_case_value(bench_case, "data:num_batches")
batch_size = get_bench_case_value(bench_case, "data:batch_size")
num_batches = get_bench_case_value(
bench_case, f"algorithm:num_batches:{stage}"
)
batch_size = get_bench_case_value(
bench_case, f"algorithm:batch_size:{stage}"
)

if batch_size is None:
if num_batches is None:
Expand Down
2 changes: 2 additions & 0 deletions sklbench/report/implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ def get_result_tables_as_df(
splitby_columns=["estimator", "method", "function"],
compatibility_mode=False,
):
print(results["bench_cases"])
bench_cases = pd.DataFrame(
[flatten_dict(bench_case) for bench_case in results["bench_cases"]]
)
Expand All @@ -244,6 +245,7 @@ def get_result_tables_as_df(
if compatibility_mode:
bench_cases = transform_results_to_compatible(bench_cases)

print(bench_cases)
for column in diffby_columns.copy():
if bench_cases[column].nunique() == 1:
bench_cases.drop(columns=[column], inplace=True)
Expand Down
Loading