From 6b33d1d0ccafa13ff32bc9c892c761487c6ab0f0 Mon Sep 17 00:00:00 2001 From: Ahmed Markhoos <ahmed.markhoos@cern.ch> Date: Mon, 10 Jul 2023 14:05:37 +0200 Subject: [PATCH] Fix seaborn deprecated ci/errorbars and re-introduce tuner warnings --- freeforestml/model.py | 5 +++-- freeforestml/plot.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/freeforestml/model.py b/freeforestml/model.py index f22aa51..3ef7179 100644 --- a/freeforestml/model.py +++ b/freeforestml/model.py @@ -5,6 +5,7 @@ import sys import h5py import json import socket +import warnings import multiprocessing as mp import numpy as np @@ -1071,8 +1072,8 @@ class HepNetSearch: self.tuner_settings = None self.ETH_IP = ETH_IP - if tuner_name not in ['Hyperband', 'RandomSearch', 'BayesianOptimization']: - raise ValueError("%s is an invalid tuner. It must be either Hyperband, etc.." % repr(tuner)) + if tuner_name not in ['Hyperband', 'RandomSearch', 'BayesianOptimization', 'GridSearch']: + warnings.warn("%s is not a tested tuner, the program might break.\nTested tuners: " % (tuner_name,repr(tuner)) ) else: self.tuner_name = tuner_name diff --git a/freeforestml/plot.py b/freeforestml/plot.py index 3eda8b4..21f52ff 100644 --- a/freeforestml/plot.py +++ b/freeforestml/plot.py @@ -507,7 +507,7 @@ def roc(df, signal_process, background_process, discriminant, steps=100, data = pd.DataFrame({"Signal efficiency": signal_effs, "1 - Background efficiency": background_ieffs}) sns.lineplot(x="Signal efficiency", y="1 - Background efficiency", data=data, - ax=axes, ci=None, label=discriminant.name) + ax=axes, errorbar=None, label=discriminant.name) axes.plot([0, 1], [1, 0], color='gray', linestyle=':') axes.set_xlim((0, 1)) -- GitLab