eqdisco.expr.PrimitiveSet#
- class eqdisco.expr.PrimitiveSet(n_features, functions=('add', 'sub', 'mul', 'div', 'sin', 'cos', 'exp', 'log', 'sqrt', 'square'), feature_names=None, p_constant=0.2, const_range=(-5.0, 5.0), function_weights=None, integer_constants=False, variable_weights=None)[source]#
Bases:
objectFunction and terminal sets of a search.
- Parameters:
- n_features
int Number of input variables \(n\).
- functionssequence
ofstrorPrimitive Function set \(\mathcal{F}\); names refer to
PRIMITIVES.- feature_namessequence
ofstr,optional Variable names (default
x0, x1, ...).- p_constant
float Probability that a random terminal is a constant rather than a variable.
- const_range
tupleoffloat Interval of the uniform distribution of new constants.
- function_weightssequence
offloat,optional Relative probabilities of drawing each function.
- integer_constantsbool
Draw integer constants (useful for exact recovery benchmarks).
- n_features