Skip to content

Commit

Permalink
Update initialization of eval_sets
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander März committed Mar 6, 2024
1 parent c586da0 commit e466fb5
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions lightgbmlss/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def train(self,
self.set_init_score(train_set)

if valid_sets is not None:
valid_sets = self.set_valid_margin(valid_sets, self.start_values)
valid_sets = self.set_valid_margin(valid_sets)

self.booster = lgb.train(params,
train_set,
Expand Down Expand Up @@ -551,24 +551,19 @@ def expectile_plot(self,

def set_valid_margin(self,
valid_sets: list,
start_values: np.ndarray
) -> list:
"""
Function that sets the base margin for the validation set.
Arguments
---------
valid_sets : list
List of tuples containing the train and evaluation set.
valid_names: list
List of tuples containing the name of train and evaluation set.
start_values : np.ndarray
Array containing the start values for the distributional parameters.
List of tuples containing the evaluation set(s).
Returns
-------
valid_sets : list
List of tuples containing the train and evaluation set.
List of tuples containing the evaluation set(s).
"""
for valid_set in valid_sets:
self.set_init_score(valid_set)
Expand Down

0 comments on commit e466fb5

Please sign in to comment.