cavalab / srbench

A living benchmark framework for symbolic regression
https://cavalab.org/srbench/
GNU General Public License v3.0
216 stars 78 forks source link

measure complexity #3

Closed lacava closed 3 years ago

lacava commented 5 years ago

we should measure complexity of the final models produced by the methods. Since they all vary quite a bit, this isn't trivial. for the SR methods, we should be able to count the number of nodes (operators and literals) in the solutions.

lacava commented 5 years ago

@jmmcd for FFXRegressor, is the # of nodes in the GP-equivalent tree given by self._models[-1].complexity() ? If not can you define it for us?

jmmcd commented 5 years ago

Yes, that's right, see https://github.com/natekupp/ffx/blob/77cc110960828dcf66e0462170319bc69a8ce34c/ffx/core.py#L285

foolnotion commented 3 years ago

In our trees, variable nodes have an associated weight, so that the output is always weight times variable value (from the dataset). Currently, these are not counted towards the complexity (e.g., a variable node has complexity 1).

Should we change this to take the multiplication into account? Such that complexity(variable node) == complexity (Multiply(variable node, constant node))) = 3 ?

lacava commented 3 years ago

@foolnotion yes, the multiplication should count. I did something similar for FEAT

lacava commented 3 years ago

complexity is self-reported, but also measured via sympy after simplification. see assess_symbolic_model.py