-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature]: ternary operators #227
Comments
Actually thinking a bit more, this could be expressed as |
Also see #102 but yeah I agree with you – generally it's surprisingly rare to need an operator that can't be expressed as a binary operator. Though it could be true that The only true ternary operators – which are not reducible – I've run into are weird basis functions used to solve some PDEs, where the operator has multiple parameters. If needed we would first need to generalize https://github.com/SymbolicML/DynamicExpressions.jl/'s node type to have some |
There's actually very few functions that need to be rewritten in the core type: https://github.com/SymbolicML/DynamicExpressions.jl/blob/6be88b78dca76013086f29f2ff22f6a532d20460/src/base.jl#L68-L136. Though there are some other mutation functions in SymbolicRegression.jl that would need to re-weight their mutation probabilities based on the max degree. |
[Diff since v0.19.1](v0.19.1...v0.20.0) **Closed issues:** - [Feature]: MLJ integration (#225) - [Feature]: ternary operators (#227) **Merged pull requests:** - MLJ Integration (#226) (@MilesCranmer)
Feature Request
This might not be feasible, but I think it would be interesting to be able to model piecewise functions. I think this would basically need something like
choice(x, y, z) = ifelse(x > 0, y, z)
.The text was updated successfully, but these errors were encountered: