Skip to content

Commit

Permalink
Fix DomainError in pareto curve; fixes #67
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Feb 2, 2022
1 parent 215900f commit ded3037
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SymbolicRegression"
uuid = "8254be44-1295-4e6a-a16d-46603ac705cb"
authors = ["MilesCranmer <miles.cranmer@gmail.com>"]
version = "0.7.5"
version = "0.7.6"

[deps]
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
Expand Down
3 changes: 2 additions & 1 deletion src/HallOfFame.jl
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ function string_dominating_pareto_curve(hallOfFame, baselineMSE,
complexity = countNodes(member.tree)
curMSE = (member.score - complexity * options.parsimony) * baselineMSE
delta_c = complexity - lastComplexity
delta_l_mse = log(curMSE/lastMSE)
ZERO_POINT = 1f-10
delta_l_mse = log(abs(curMSE/lastMSE) + ZERO_POINT)
score = convert(Float32, -delta_l_mse/delta_c)
output *= @sprintf("%-10d %-8.3e %-8.3e %-s\n" , complexity, curMSE, score, stringTree(member.tree, options, varMap=dataset.varMap))
lastMSE = curMSE
Expand Down

2 comments on commit ded3037

@MilesCranmer
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/53658

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.6 -m "<description of version>" ded303765cf9c3ffa298adb6d37c847be71f321a
git push origin v0.7.6

Please sign in to comment.