Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
15 changes: 15 additions & 0 deletions configs/common/covariance.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"INCLUDE": ["../common/sklearn.json"],
"PARAMETERS_SETS": {
"covariance parameters": {
"algorithm": {
"estimator": "EmpiricalCovariance",
"estimator_params": {
"store_precision": [true, false],
"assume_centered": false
},
"estimator_methods": { "training": "fit" }
}
}
}
}
18 changes: 18 additions & 0 deletions configs/common/sklearn.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,24 @@
"data": { "format": "dpnp", "order": "C" }
}
],
"sklearn-ex[cpu] preview implementations": {
"algorithm": [
{ "library": "sklearn", "device": "cpu" },
{ "library": "sklearnex.preview", "device": "cpu" }
]
},
"sklearn-ex[cpu,gpu] preview implementations": [
{ "algorithm": { "library": "sklearn", "device": "cpu" } },
{ "algorithm": { "library": "sklearnex.preview", "device": "cpu" } },
{
"algorithm": {
"library": "sklearnex.preview",
"device": "gpu",
"sklearn_context": { "array_api_dispatch": true }
},
"data": { "format": "dpnp", "order": "C" }
}
],
"sklearnex spmd implementation": {
"algorithm": {
"library": "sklearnex.spmd",
Expand Down
29 changes: 29 additions & 0 deletions configs/experiments/covariance.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"INCLUDE": ["../common/sklearn.json", "../common/covariance.json"],
"PARAMETERS_SETS": {
"covariance datasets": [
{
"data": {
"source": "make_blobs",
"generation_kwargs": [
{ "n_samples": 10000000, "n_features": 50, "centers": 1 },
{ "n_samples": 2000000, "n_features": 500, "centers": 1 },
{ "n_samples": 200000, "n_features": 2000, "centers": 1 }
],
"split_kwargs": { "ignore": true }
}
},
{
"data": {
"dataset": ["susy", "higgs"],
"split_kwargs": { "ignore": true }
}
}
]
},
"TEMPLATES": {
"sklearn covariance": {
"SETS": ["sklearn-ex[cpu,gpu] preview implementations", "covariance parameters", "covariance datasets"]
}
}
}
33 changes: 33 additions & 0 deletions configs/weekly/covariance.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"INCLUDE": ["../common/sklearn.json", "../common/covariance.json"],
"PARAMETERS_SETS": {
"high-load covariance datasets": [
{
"data": {
"source": "make_blobs",
"generation_kwargs": [
{ "n_samples": 50000000, "n_features": 50, "centers": 1 },
{ "n_samples": 10000000, "n_features": 500, "centers": 1 },
{ "n_samples": 1000000, "n_features": 5000, "centers": 1 }
],
"split_kwargs": { "ignore": true }
}
},
{
"data": {
"dataset": ["airline_depdelay", "epsilon"],
"split_kwargs": { "ignore": true }
}
}
]
},
"TEMPLATES": {
"sklearn covariance": {
"SETS": [
"sklearn-ex[cpu,gpu] preview implementations",
"covariance parameters",
"high-load covariance datasets"
]
}
}
}
9 changes: 9 additions & 0 deletions sklbench/benchmarks/sklearn_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,15 @@ def get_subset_metrics_of_estimator(
)
}
)
elif task == "utility":
# SPMD estimators are skipped: their score triggers an additional collective fit
if (
"Covariance" in str(estimator_instance)
and stage == "training"
and hasattr(estimator_instance, "score")
and "spmd" not in type(estimator_instance).__module__
):
metrics.update({"average log-likelihood": float(estimator_instance.score(x))})
elif task == "clustering":
if hasattr(estimator_instance, "inertia_"):
# compute inertia manually using distances to cluster centers
Expand Down
2 changes: 1 addition & 1 deletion sklbench/report/implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"indifferent": [
# SVM
"support vectors",
# PCA
# PCA, EmpiricalCovariance
"average log-likelihood",
"1st component variance ratio",
# DBSCAN
Expand Down
Loading