lib/eps/lightgbm.rb in eps-0.3.4 vs lib/eps/lightgbm.rb in eps-0.3.5
- old
+ new
@@ -15,11 +15,11 @@
end
end
str
end
- def _train(verbose: nil, early_stopping: nil)
+ def _train(verbose: nil, early_stopping: nil, learning_rate: 0.1)
train_set = @train_set
validation_set = @validation_set.dup
summary_label = train_set.label
# create check set
@@ -58,10 +58,13 @@
# text feature encoding
prep_text_features(train_set)
prep_text_features(validation_set) if validation_set
# create params
- params = {objective: objective}
+ params = {
+ objective: objective,
+ learning_rate: learning_rate
+ }
params[:num_classes] = labels.size if objective == "multiclass"
if train_set.size < 30
params[:min_data_in_bin] = 1
params[:min_data_in_leaf] = 1
end