Skip to content

Commit f21c0ff

Browse files
author
Maximilian Reißmann
committed
add costum loss fun
1 parent 942a460 commit f21c0ff

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/src/examples/basic-regression.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ if hasfield(typeof(regressor), :fitness_history_) &&
119119
!isnothing(regressor.fitness_history_) &&
120120
hasfield(typeof(regressor.fitness_history_), :train_loss)
121121

122-
fitness_history = regressor.fitness_history_.train_loss
122+
fitness_history = [elem[1] for elem in regressor.fitness_history_.train_loss]
123123

124124
p1 = plot(1:length(fitness_history), fitness_history,
125125
xlabel="Generation",

src/RegressionWrapper.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ function fit!(regressor::GepRegressor, epochs::Int, population_size::Int, x_trai
738738
y_train,
739739
!isnothing(x_test) ? x_test : x_train,
740740
!isnothing(y_test) ? y_test : y_train,
741-
get_loss_function(loss_fun);
741+
loss_fun isa String ? get_loss_function(loss_fun) : loss_fun;
742742
secOptimizer=optimizer_wrapper,
743743
break_condition=break_condition
744744
)

0 commit comments

Comments
 (0)