mirror of
https://github.com/Doctorado-ML/benchmark.git
synced 2025-08-20 01:45:54 +00:00
fix build_grid style issues
This commit is contained in:
@@ -14,7 +14,8 @@ data = [
|
|||||||
'{"kernel": "rbf"}',
|
'{"kernel": "rbf"}',
|
||||||
'{"C": 1.05, "gamma": "auto","kernel": "rbf"}',
|
'{"C": 1.05, "gamma": "auto","kernel": "rbf"}',
|
||||||
'{"splitter": "random", "max_features": "auto"}',
|
'{"splitter": "random", "max_features": "auto"}',
|
||||||
'{"C": 0.05, "max_features": "auto", "kernel": "liblinear", "multiclass_strategy": "ovr"}',
|
'{"C": 0.05, "max_features": "auto", "kernel": "liblinear", '
|
||||||
|
'"multiclass_strategy": "ovr"}',
|
||||||
'{"kernel": "rbf", "C": 0.05}',
|
'{"kernel": "rbf", "C": 0.05}',
|
||||||
'{"C": 0.05, "kernel": "liblinear", "multiclass_strategy": "ovr"}',
|
'{"C": 0.05, "kernel": "liblinear", "multiclass_strategy": "ovr"}',
|
||||||
'{"C": 7, "gamma": 0.1, "kernel": "rbf"}',
|
'{"C": 7, "gamma": 0.1, "kernel": "rbf"}',
|
||||||
@@ -27,13 +28,15 @@ data = [
|
|||||||
'{"C": 2.8, "kernel": "rbf", "gamma": "auto"}',
|
'{"C": 2.8, "kernel": "rbf", "gamma": "auto"}',
|
||||||
'{"kernel": "rbf"}',
|
'{"kernel": "rbf"}',
|
||||||
'{"C": 0.05, "gamma": 0.1, "kernel": "poly"}',
|
'{"C": 0.05, "gamma": 0.1, "kernel": "poly"}',
|
||||||
'{"C": 8.25, "gamma": 0.1, "kernel": "poly", "multiclass_strategy": "ovr"}',
|
'{"C": 8.25, "gamma": 0.1, "kernel": "poly", "multiclass_strategy": '
|
||||||
|
'"ovr"}',
|
||||||
'{"kernel": "liblinear", "multiclass_strategy": "ovr"}',
|
'{"kernel": "liblinear", "multiclass_strategy": "ovr"}',
|
||||||
'{"C": 1.75, "kernel": "liblinear", "multiclass_strategy": "ovr"}',
|
'{"C": 1.75, "kernel": "liblinear", "multiclass_strategy": "ovr"}',
|
||||||
'{"C":57, "kernel": "rbf"}',
|
'{"C":57, "kernel": "rbf"}',
|
||||||
'{"C": 7, "gamma": 0.1, "kernel": "rbf", "multiclass_strategy": "ovr"}',
|
'{"C": 7, "gamma": 0.1, "kernel": "rbf", "multiclass_strategy": "ovr"}',
|
||||||
'{"C": 5, "kernel": "rbf", "gamma": "auto"}',
|
'{"C": 5, "kernel": "rbf", "gamma": "auto"}',
|
||||||
'{"C": 0.05, "max_iter": 10000.0, "kernel": "liblinear", "multiclass_strategy": "ovr"}',
|
'{"C": 0.05, "max_iter": 10000.0, "kernel": "liblinear", '
|
||||||
|
'"multiclass_strategy": "ovr"}',
|
||||||
'{"C":0.0275, "kernel": "liblinear", "multiclass_strategy": "ovr"}',
|
'{"C":0.0275, "kernel": "liblinear", "multiclass_strategy": "ovr"}',
|
||||||
'{"C": 7, "gamma": 10.0, "kernel": "rbf", "multiclass_strategy": "ovr"}',
|
'{"C": 7, "gamma": 10.0, "kernel": "rbf", "multiclass_strategy": "ovr"}',
|
||||||
'{"kernel": "rbf", "gamma": 0.001}',
|
'{"kernel": "rbf", "gamma": 0.001}',
|
||||||
@@ -59,16 +62,14 @@ for kernel in kernels:
|
|||||||
for item in hyper:
|
for item in hyper:
|
||||||
results[kernel][item] = []
|
results[kernel][item] = []
|
||||||
# load data
|
# load data
|
||||||
for item in data:
|
for sample in data:
|
||||||
line = json.loads(item)
|
line = json.loads(sample)
|
||||||
if "kernel" not in line:
|
if "kernel" not in line:
|
||||||
line["kernel"] = "linear"
|
line["kernel"] = "linear"
|
||||||
kernel = line["kernel"]
|
kernel = line["kernel"]
|
||||||
for item in hyper:
|
for item in hyper:
|
||||||
if item in line:
|
if item in line and line[item] not in results[kernel][item]:
|
||||||
results[kernel][item].append(line[item]) if line[
|
results[kernel][item].append(line[item])
|
||||||
item
|
|
||||||
] not in results[kernel][item] else None
|
|
||||||
|
|
||||||
# Add default values and remove inconsistent values
|
# Add default values and remove inconsistent values
|
||||||
results["linear"]["multiclass_strategy"] = ["ovo"]
|
results["linear"]["multiclass_strategy"] = ["ovo"]
|
||||||
@@ -86,7 +87,7 @@ for item in results:
|
|||||||
new_key = f"base_estimator__{key}"
|
new_key = f"base_estimator__{key}"
|
||||||
try:
|
try:
|
||||||
results_tmp[new_key] = sorted(value)
|
results_tmp[new_key] = sorted(value)
|
||||||
except:
|
except TypeError:
|
||||||
t1 = sorted(
|
t1 = sorted(
|
||||||
[
|
[
|
||||||
x
|
x
|
||||||
|
Reference in New Issue
Block a user