Skip to content
Discussion options

You must be logged in to vote

Thanks. In this case you can do it with a template expression like this:

template = TemplateExpressionSpec(
    expressions=["f",],
    variable_names=["x"],
    parameters={"p": 2}
    combine="""
        A, n = p[1], p[2]
        axn = A * x ^ n
        f(x, axn)
    """
)
model = PySRRegressor(
    expression_spec=template,
    binary_operators=["+", "*", "-", "/"],
)

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@janzenchoi
Comment options

@MilesCranmer
Comment options

Answer selected by janzenchoi
@janzenchoi
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants