Skip to content
Snippets Groups Projects
Commit a0408dc1 authored by Luc Giffon's avatar Luc Giffon
Browse files

show negative correlation between score and percent negative

parent 43c18761
No related branches found
No related tags found
1 merge request!24Resolve "non negative omp"
...@@ -19,7 +19,8 @@ tasks = [ ...@@ -19,7 +19,8 @@ tasks = [
# "correlation", # "correlation",
# "negative-percentage", # "negative-percentage",
"dev_strength", "dev_strength",
"test_strength" "test_strength",
"negative-percentage-test-score"
] ]
dct_score_metric_fancy = { dct_score_metric_fancy = {
...@@ -108,6 +109,40 @@ if __name__ == "__main__": ...@@ -108,6 +109,40 @@ if __name__ == "__main__":
for strat in strategies: for strat in strategies:
if strat in lst_skip_strategy: if strat in lst_skip_strategy:
continue continue
if task == "negative-percentage-test-score":
if strat == "OMP":
df_strat = df_data[df_data["strategy"] == strat]
df_strat = df_strat[df_strat["subset"] == "train+dev/train+dev"]
df_strat_wo_weights = df_strat[df_strat["wo_weights"] == False]
df_groupby_forest_size = df_strat_wo_weights.groupby(['forest_size'])
forest_sizes = df_groupby_forest_size["forest_size"].mean().values
x_values = df_groupby_forest_size["negative-percentage"].mean().values
y_values = df_groupby_forest_size["test_score"].mean().values
# print(df_strat)
fig.add_trace(go.Scatter(x=x_values, y=y_values,
mode='markers',
name=strat,
# color=forest_sizes,
marker=dict(
# size=16,
# cmax=39,
# cmin=0,
color=forest_sizes,
colorbar=dict(
title="Forest Size"
),
# colorscale="Viridis"
),
# marker=dict(color="rgb{}".format(dct_color_by_strategy[strat]))
))
continue
df_strat = df_data[df_data["strategy"] == strat] df_strat = df_data[df_data["strategy"] == strat]
df_strat = df_strat[df_strat["subset"] == "train+dev/train+dev"] df_strat = df_strat[df_strat["subset"] == "train+dev/train+dev"]
...@@ -135,9 +170,10 @@ if __name__ == "__main__": ...@@ -135,9 +170,10 @@ if __name__ == "__main__":
title = "{} {}".format(task, data_name) title = "{} {}".format(task, data_name)
yaxis_title = "% negative weights" if task == "negative-percentage" else dct_score_metric_fancy[score_metric_name] yaxis_title = "% negative weights" if task == "negative-percentage" else dct_score_metric_fancy[score_metric_name]
xaxis_title = "% negative weights" if task == "negative-percentage-test-score" else "# Selected Trees"
fig.update_layout(barmode='group', fig.update_layout(barmode='group',
# title=title, # title=title,
xaxis_title="# Selected Trees", xaxis_title=xaxis_title,
yaxis_title=yaxis_title, yaxis_title=yaxis_title,
font=dict( font=dict(
# family="Courier New, monospace", # family="Courier New, monospace",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment