
Symbolic regression with a Pareto front (PySR scheme)
Source:R/SymbolicRegression.R
PysrRegression.RdRegularized evolution of prefix expression trees over + - * / and chosen
unary operators: tournament selection on loss + parsimony x size (mean
squared error loss), subtree crossover or one mutation, rejection above
maxsize, replacement of the oldest member; a hall of fame keeps the best
expression of each size, its Pareto front carries PySR's score
-d log(loss) / d size and best is the top-scoring member within 1.5
times the smallest loss. Philox draws; identical to the Python arm
morie.fn.symreg.
Usage
PysrRegression(
X,
y,
unary_operators = character(0),
niterations = 30L,
population_size = 60L,
maxsize = 20L,
tournament_size = 8L,
crossover_probability = 0.1,
parsimony = 0.0032,
seed = 1
)Arguments
- X
Numeric matrix of predictors.
- y
Response vector.
- unary_operators
Character vector from sin, cos, exp, log, sqrt, square.
- niterations
Iterations (each of population_size steps).
- population_size
Population size.
- maxsize
Largest expression size.
- tournament_size
Tournament size.
- crossover_probability
Probability of crossover instead of mutation.
- parsimony
Size penalty in selection.
- seed
Philox seed.
Value
List: equations (data frame of complexity, loss, equation, score), best (list) and prediction.