From c586da024a4f6760f141bf4a3fc378f807ce9ef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20M=C3=A4rz?= Date: Wed, 6 Mar 2024 10:13:50 +0100 Subject: [PATCH] Update initialization of eval_sets --- lightgbmlss/model.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/lightgbmlss/model.py b/lightgbmlss/model.py index 3693ee7..f966a87 100644 --- a/lightgbmlss/model.py +++ b/lightgbmlss/model.py @@ -570,15 +570,8 @@ def set_valid_margin(self, valid_sets : list List of tuples containing the train and evaluation set. """ - valid_sets1 = valid_sets[0] - init_score_val1 = (np.ones(shape=(valid_sets1.get_label().shape[0], 1))) * start_values - valid_sets1.set_init_score(init_score_val1.ravel(order="F")) - - valid_sets2 = valid_sets[1] - init_score_val2 = (np.ones(shape=(valid_sets2.get_label().shape[0], 1))) * start_values - valid_sets2.set_init_score(init_score_val2.ravel(order="F")) - - valid_sets = [valid_sets1, valid_sets2] + for valid_set in valid_sets: + self.set_init_score(valid_set) return valid_sets