Skip to content
Snippets Groups Projects
Commit 06088b28 authored by Tamino Huxohl's avatar Tamino Huxohl
Browse files

fix missing import in eval outlier

parent dc9c3e2d
No related branches found
No related tags found
No related merge requests found
import pandas as pd
from mu_map.random_search.eval.params import parameter_groups from mu_map.random_search.eval.params import parameter_groups
from mu_map.random_search.eval.util import filter_by_params, load_data, remove_outliers from mu_map.random_search.eval.util import filter_by_params, load_data, remove_outliers
...@@ -11,16 +13,21 @@ outlier_runs = list(outlier_runs["run"]) ...@@ -11,16 +13,21 @@ outlier_runs = list(outlier_runs["run"])
data_outlier = dict(filter(lambda i: i[0] in outlier_runs, data.items())) data_outlier = dict(filter(lambda i: i[0] in outlier_runs, data.items()))
n_outlier = len(data_outlier) n_outlier = len(data_outlier)
print(f"There are {n_outlier} outlier runs in {n_total} total runs which is {100 * n_outlier / n_total:.2f}%") print(
f"There are {n_outlier} outlier runs in {n_total} total runs which is {100 * n_outlier / n_total:.2f}%"
)
print() print()
print(f"By Parameters:") print(f"By Parameters:")
for param_label, param_groups in parameter_groups.items(): for param_label, param_groups in parameter_groups.items():
param_label = " ".join(map(lambda _str: _str[0].upper() + _str[1:], param_label.split("_"))) param_label = " ".join(
map(lambda _str: _str[0].upper() + _str[1:], param_label.split("_"))
)
print(f" - {param_label}") print(f" - {param_label}")
for label, value in param_groups.groups.items(): for label, value in param_groups.groups.items():
n_outlier = len(filter_by_params(data_outlier, value, param_groups.keys)) n_outlier = len(filter_by_params(data_outlier, value, param_groups.keys))
n_total = len(filter_by_params(data, value, param_groups.keys)) n_total = len(filter_by_params(data, value, param_groups.keys))
print(f" - {label:>12}: {str(n_outlier):>2}/{str(n_total):>2} = {100 * n_outlier / n_total:.2f}%") print(
f" - {label:>12}: {str(n_outlier):>2}/{str(n_total):>2} = {100 * n_outlier / n_total:.2f}%"
)
print() print()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment