From a8aa750a40531bb18c2e5f01b302b47f501e24db Mon Sep 17 00:00:00 2001 From: "hendrik.dewinter" Date: Wed, 22 Sep 2021 11:22:50 +0200 Subject: [PATCH 1/2] small fix for y axis on performance curve plot (regression version) --- cobra/evaluation/plotting_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cobra/evaluation/plotting_utils.py b/cobra/evaluation/plotting_utils.py index 2318a58..57f869d 100644 --- a/cobra/evaluation/plotting_utils.py +++ b/cobra/evaluation/plotting_utils.py @@ -134,7 +134,7 @@ def plot_performance_curves(model_performance: pd.DataFrame, if model_type == "classification": ax.set_yticks(np.arange(0.5, max_metric + 0.02, 0.05)) elif model_type == "regression": - ax.set_yticks(np.arange(0, max_metric*1.02, np.floor(max_metric/10))) + ax.set_yticks(np.arange(0, max_metric+1)) # Make pretty ax.legend(loc='lower right') From 2bffe82fb9e988305fed3825fb07b21689f35c2f Mon Sep 17 00:00:00 2001 From: "hendrik.dewinter" Date: Wed, 22 Sep 2021 17:22:22 +0200 Subject: [PATCH 2/2] Latest fix for y axis on performance curve plot (regression version) --- cobra/evaluation/plotting_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cobra/evaluation/plotting_utils.py b/cobra/evaluation/plotting_utils.py index 57f869d..245dda2 100644 --- a/cobra/evaluation/plotting_utils.py +++ b/cobra/evaluation/plotting_utils.py @@ -134,7 +134,7 @@ def plot_performance_curves(model_performance: pd.DataFrame, if model_type == "classification": ax.set_yticks(np.arange(0.5, max_metric + 0.02, 0.05)) elif model_type == "regression": - ax.set_yticks(np.arange(0, max_metric+1)) + ax.set_yticks(np.arange(0, max_metric+(0.1*max_metric))) # Make pretty ax.legend(loc='lower right')