Class: SymbolicRegression

SymbolicRegression

new SymbolicRegression(data)

Fitness function for fitting data, i.e. supervised learning. Symbolic regression is a type of regression analysis that searches the space of mathematical expressions to find the model that best fits a given dataset. Evaluate fitness based on fitness cases and target values. Fitness cases are a set of exemplars (input and output points) by comparing the error between the output of an individual(symbolic expression) and the target values.
Parameters:
Name Type Description
data array Exemplars to evaluate individual solutions on. The last column is the label
Source:

Methods

evaluate(node, inputData) → {number}

Evaluate the model (f) on the input data (x_0,...,x_n), i.e. f(x_0,...,x_n). Evaluate a node recursively. The node's symbol is evaluated.
Parameters:
Name Type Description
node TreeNode Node that is evaluated
inputData array Data of the input variables x_0, ..., x_n
Source:
Returns:
Value of the evaluation, i.e. f(x)
Type
number

evaluateIndividual(individual) → {number}

Evaluate the individual solution (model) on all the data. Fitness is the negative Mean Squared Error.
Parameters:
Name Type Description
individual Individual Individual solution to evaluate
Source:
Returns:
Fitness, the negative MSE
Type
number

evaluatePopulation(Population) → {array}

Assign fitness to each individual solution in the population.
Parameters:
Name Type Description
Population array List of Individuals
Source:
Returns:
Evaluated population
Type
array