Skip to content

Releases: MilesCranmer/SymbolicRegression.jl

v1.7.1

09 Feb 22:38
ea13e3d
Compare
Choose a tag to compare

SymbolicRegression v1.7.1

Diff since v1.7.0

Merged pull requests:

Closed issues:

  • [BUG]: scitype warning (#405)

v1.7.0

08 Feb 20:45
40f90bc
Compare
Choose a tag to compare

What's Changed

New Features

  • Parametric Template Expressions: You can now add learnable parameters to template expressions! It's easiest to set this up with the new @template_spec macro: (#394)
    @template_spec(expressions=(f, g), parameters=(amplitude=2, phase=2, offset=1)) do x, class
        amplitude[class] * cos(f(x) + phase[class]) + g(x)^2 + offset[1]
    end
  • Loss Functions on AbstractExpression objects: New loss_function_expression parameter enables custom loss functions that operate directly on TemplateExpression and other expression objects. (#408)
  • Expression specifications: Rather than setting both expression_type and expression_options, there is now a unified expression_spec argument for Options and SRRegressor. Use ParametricExpressionSpec for parametric expressions, and TemplateExpressionSpec for template expressions. (Though the latter has the @template_spec shorthand)

Small changes

  • Added support for comparison operators (>, <, >=, <=) within templates as well as in the operators. (#407)

Deprecations

  • The expression_type and expression_options parameters are now deprecated in favor of the unified expression_spec interface.

Example Usage

Class-Conditional Model with Learnable Parameters

# Define template with class-specific parameters
model_template = @template_spec(
    expressions=(base, modifier),
    parameters=(coeff=5,)
) do x, class
    coeff[class] * (base(x) + modifier(x^2))
end

# Set up search
model = SRRegressor(
    expression_spec=model_template,
    binary_operators=[+, *],
    unary_operators=[cos],
    niterations=500
)

# X contains features x and class labels
X = (x=rand(100) .* 10, class=rand(1:5, 100))
coeffs = [2.0, -0.5, 4.0, 0.2, 1.0]
y = [coeffs[X.class[i]] * (cos(X.x[i]) - X.x[i]^2) for i in 1:100]

using MLJBase: fit!, machine
fit!(machine(model, X, y))

Full Changelog: v1.6.0...v1.7.0

v1.6.0

02 Feb 14:53
7dd47fa
Compare
Choose a tag to compare

SymbolicRegression v1.6.0

Diff since v1.5.2

Merged pull requests:

Closed issues:

  • [Feature] Reusing parts of equation (#113)

v1.5.2

03 Jan 13:32
e5afc91
Compare
Choose a tag to compare

SymbolicRegression v1.5.2

Diff since v1.5.1

Merged pull requests:

  • Broaden MLJ target_scitype only when using TemplateExpression (#392) (@MilesCranmer)
  • Change get_tournament_selection_weights function signature (#395) (@atharvas)
  • fix for turbo and bumper not being used in TemplateExpression (#399) (@MilesCranmer)

Closed issues:

  • [BUG]: [MLJ Interface] SRRegressor likely has too broad a target_scitype (#390)

v1.5.1

26 Dec 23:28
2cd4c1a
Compare
Choose a tag to compare

SymbolicRegression v1.5.1

Diff since v1.5.0

Merged pull requests:

  • CompatHelper: bump compat for DynamicExpressions to 1.9, (keep existing compat) (#391) (@github-actions[bot])
  • fix: higher order safe operators (#396) (@MilesCranmer)
  • fix: add literal_pow for composable expression (#397) (@MilesCranmer)

Closed issues:

  • [BUG]: Symbolic regression fails with a dimension mismatch (#389)

v1.5.0

14 Dec 22:37
6387d54
Compare
Choose a tag to compare

SymbolicRegression v1.5.0

Diff since v1.4.0

Merged pull requests:

v1.4.0

13 Dec 23:27
5755693
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.3.1...v1.4.0

v1.3.1

11 Dec 07:06
65111cf
Compare
Choose a tag to compare

SymbolicRegression v1.3.1

Diff since v1.3.0

Merged pull requests:

v1.3.0

09 Dec 17:52
ad13595
Compare
Choose a tag to compare

SymbolicRegression v1.3.0

Diff since v1.2.0

Merged pull requests:

Closed issues:

  • [BUG]: frozen REPL in VSCode (#370)
  • [Feature]: More constant symplification? (#381)

v1.2.0

08 Dec 13:06
3565421
Compare
Choose a tag to compare

SymbolicRegression v1.2.0

Diff since v1.1.0

Merged pull requests:

Closed issues:

  • [BUG]: nested_constraints incompatible with TemplateExpression (#378)