MilesCranmer commited on
Commit
87afd92
·
1 Parent(s): 82dd9a0

Fix scoring function - extra logarithm was added

Browse files
Files changed (1) hide show
  1. julia/sr.jl +3 -3
julia/sr.jl CHANGED
@@ -855,7 +855,7 @@ function fullRun(niterations::Integer;
855
  @printf("Hall of Fame:\n")
856
  @printf("-----------------------------------------\n")
857
  @printf("%-10s %-8s %-8s %-8s\n", "Complexity", "MSE", "Score", "Equation")
858
- curMSE = baselineSSE ./ len
859
  @printf("%-10d %-8.3e %-8s %-.f\n", 0, curMSE, "NaN", avgy)
860
  lastMSE = curMSE
861
  lastComplexity = 0
@@ -873,8 +873,8 @@ function fullRun(niterations::Integer;
873
  betterThanAllSmaller = (numberSmallerAndBetter == 0)
874
  if betterThanAllSmaller
875
  delta_c = size - lastComplexity
876
- delta_l_mse = log(curMSE) - log(lastMSE)
877
- score = convert(Float32, -delta_l_mse/log(delta_c))
878
  @printf("%-10d %-8.3e %-8.3e %-s\n" , size, curMSE, score, stringTree(member.tree))
879
  lastMSE = curMSE
880
  lastComplexity = size
 
855
  @printf("Hall of Fame:\n")
856
  @printf("-----------------------------------------\n")
857
  @printf("%-10s %-8s %-8s %-8s\n", "Complexity", "MSE", "Score", "Equation")
858
+ curMSE = baselineSSE / len
859
  @printf("%-10d %-8.3e %-8s %-.f\n", 0, curMSE, "NaN", avgy)
860
  lastMSE = curMSE
861
  lastComplexity = 0
 
873
  betterThanAllSmaller = (numberSmallerAndBetter == 0)
874
  if betterThanAllSmaller
875
  delta_c = size - lastComplexity
876
+ delta_l_mse = log(curMSE/lastMSE)
877
+ score = convert(Float32, -delta_l_mse/delta_c)
878
  @printf("%-10d %-8.3e %-8.3e %-s\n" , size, curMSE, score, stringTree(member.tree))
879
  lastMSE = curMSE
880
  lastComplexity = size