Skip to content

How to predict using multiply equations? #607

Answered by MilesCranmer
leelew asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks!

The equations are stored in model.equations_ in a pandas dataframe.

For example:

model  # fitted PySRRegressor

for i in range(len(model.equations_)):
    print("Equation", i, "equal to", model.sympy(i))
    print("with predictions")
    pred = model.predict(X, i)
    print(pred)

This assumes 1-dimensional y. For 2 dimensional you would need to iterate over each component too.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@leelew
Comment options

Answer selected by leelew
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