Types

Equations

Equations are specified as binary trees with the Node type. Operators defined in Base are re-defined for Node types, so that one can use, e.g., t=Node(1) * 3f0 to create a tree.

SymbolicRegression.NodeMethod
Node(op::Int, l::Union{AbstractFloat, Int})

Short-form for creating a scalar/variable node, and applying a unary operator

source
SymbolicRegression.NodeMethod
Node(op::Int, l::Node, r::Node)

Apply binary operator op (enumerating over the order given) to Nodes l and r

source
SymbolicRegression.NodeMethod
Node(op::Int, l::Union{AbstractFloat, Int}, r::Node)

Short-form to create a scalar/variable node, and apply a binary operator

source
SymbolicRegression.NodeMethod
Node(op::Int, l::Node, r::Union{AbstractFloat, Int})

Short-form to create a scalar/variable node, and apply a binary operator

source
SymbolicRegression.NodeMethod
Node(op::Int, l::Union{AbstractFloat, Int}, r::Union{AbstractFloat, Int})

Short-form for creating two scalar/variable node, and applying a binary operator

source

Population

Groups of equations are given as a population, which is an array of trees tagged with score and birthdate–-these values are given in the PopMember.

SymbolicRegression.PopulationMethod
Population(dataset::Dataset{T}, baseline::T;
           npop::Int, nlength::Int=3, options::Options,
           nfeatures::Int)

Create random population and score them on the dataset.

source
SymbolicRegression.PopulationMethod
Population(X::AbstractMatrix{T}, y::AbstractVector{T},
           baseline::T; npop::Int, nlength::Int=3,
           options::Options, nfeatures::Int)

Create random population and score them on the dataset.

source

Population members

SymbolicRegression.PopMemberMethod
PopMember(t::Node, score::T)

Create a population member with a birth date at the current time.

Arguments

  • t::Node: The tree for the population member.
  • score::T: The loss to assign this member.
source
SymbolicRegression.PopMemberMethod
PopMember(dataset::Dataset{T}, baseline::T,
          t::Node, options::Options)

Create a population member with a birth date at the current time. Automatically compute the score for this tree.

Arguments

  • dataset::Dataset{T}: The dataset to evaluate the tree on.
  • baseline::T: The baseline loss.
  • t::Node: The tree for the population member.
  • options::Options: What options to use.
source

Hall of Fame

SymbolicRegression.HallOfFameMethod
HallOfFame(options::Options)

Create empty HallOfFame. The HallOfFame stores a list of PopMember objects in .members, which is enumerated by size (i.e., .members[1] is the constant solution). .exists is used to determine whether the particular member has been instantiated or not.

source

Dataset

SymbolicRegression.DatasetMethod
Dataset(X::AbstractMatrix{T}, y::AbstractVector{T};
        weights::Union{AbstractVector{T}, Nothing}=nothing,
        varMap::Union{Array{String, 1}, Nothing}=nothing)

Construct a dataset to pass between internal functions.

source