From 4047c34d46c7a0d45cc4c539dcae27c8bfb0b7b4 Mon Sep 17 00:00:00 2001 From: Piotrek Date: Wed, 27 May 2020 16:17:11 +0200 Subject: [PATCH] better names (#90) --- supervised/automl.py | 3 ++- supervised/ensemble.py | 2 +- supervised/tuner/mljar_tuner.py | 2 +- supervised/utils/learning_curves.py | 4 +++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/supervised/automl.py b/supervised/automl.py index 3901d895..cd740205 100644 --- a/supervised/automl.py +++ b/supervised/automl.py @@ -660,7 +660,8 @@ def stacked_ensemble_step(self): params = copy.deepcopy(m.params) params["validation"]["X_train_path"] = X_train_stacked_path - params["name"] = "Stacked" + params["name"] + + params["name"] = params["name"] + "_Stacked" params["is_stacked"] = True if "model_architecture_json" in params["learner"]: diff --git a/supervised/ensemble.py b/supervised/ensemble.py index d3570faf..cdf61a7e 100644 --- a/supervised/ensemble.py +++ b/supervised/ensemble.py @@ -50,7 +50,7 @@ def __init__( self._additional_metrics = None self._threshold = None - self._name = "stacked_ensemble" if is_stacked else "ensemble" + self._name = "Ensemble_Stacked" if is_stacked else "Ensemble" self._scores = [] self.oof_predictions = None diff --git a/supervised/tuner/mljar_tuner.py b/supervised/tuner/mljar_tuner.py index a320f3e2..5bea2cd3 100644 --- a/supervised/tuner/mljar_tuner.py +++ b/supervised/tuner/mljar_tuner.py @@ -44,7 +44,7 @@ def __init__( self._unique_params_keys = [] def get_model_name(self, model_type, models_cnt, special = ""): - return special + model_type.replace(" ", "")+ f"_{models_cnt}" + return f"{models_cnt}_" + special + model_type.replace(" ", "") def simple_algorithms_params(self): models_cnt = 0 diff --git a/supervised/utils/learning_curves.py b/supervised/utils/learning_curves.py index 38090438..93fc14dc 100644 --- a/supervised/utils/learning_curves.py +++ b/supervised/utils/learning_curves.py @@ -58,8 +58,10 @@ def plot_single_iter(validation_splits, metric_name, model_path, colors): ) plt.bar(f"Fold {l+1}, test", df.test[0], color=colors[l]) - plt.tight_layout(pad=2.0) + plt.ylabel(metric_name) + plt.xticks(rotation=90) + plt.tight_layout(pad=2.0) plot_path = os.path.join(model_path, LearningCurves.output_file_name) plt.savefig(plot_path) plt.close("all")