Repository navigation
Replies: 1 comment 2 replies
|
You can already build the raw-unit column from the exported SymPy expressions. For a single-output model with feature selection disabled, fitted on import sympy as sp
model.refresh()
hof = model.equations_.copy()
substitutions = {
sp.Symbol(name): (sp.Symbol(name) - mean) / scale
for name, mean, scale in zip(
model.feature_names_in_, x_scaler.mean_, x_scaler.scale_
)
}
hof["Raw_Equation"] = hof["sympy_format"].map(
lambda expr: expr.subs(substitutions, simultaneous=True)
)Keep the scaler fitted on the training data, with the same feature order. Use PySR's export code supplies I checked this substitution on synthetic expressions with fitted scikit-learn scalers, including a constant feature and target scaling. I did not run a PySR search. The existing complexity and loss columns still describe the standardized search, so I would keep this as a separate export rather than replace |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi @MilesCranmer / Team,
I have a QoL request for running standardised data. Often standardisation (e.g. mean 0, sd 1) comes with massive speed ups and better convergence. When using SR across a lot of different projects, it becomes quite tedious to make the resulting pareto-front work with raw values.
What would be great is to have an option for standardisation (e.g. standardize = true/false), then a "Raw_Equation" column in HoF? If standardize = true, then SR could run with standardised X, then the Raw_Equation column could be the affine transformations substituted back to the expression tree. Perhaps I am working inefficiently and there is a better way!
George
All reactions