Discovering Equations from Data with PythonSymbolic regression, genetic programming and the eqdisco toolbox

Appendix C
The example gallery

Every method of the toolbox has at least one runnable example script. The scripts generate or load their own data, explain the method in their comments, and end with a study of the main parameters. The same scripts produce the gallery of the online documentation, the Jupyter notebooks, and every computed figure and code listing of this book. The tables below list them by folder of examples/, with the first figure of the book that each script produced.

C.1 First steps: expressions, search spaces, scaling

Folder examples/01_basics/. The methods are described in chapter 2.

Script

Topic

Figure

plot_01_expressions.py

Expressions: trees, evaluation, derivatives and bounds

2.2

   

plot_02_kepler.py

A first search: Kepler’s third law from the planets

1.2

   

plot_03_search_space.py

The size of the search space and the meaning of complexity

2.3

   

plot_04_linear_scaling.py

Linear scaling: let regression handle offset and scale

2.4

   

C.2 Genetic programming

Folder examples/02_gp/. The methods are described in chapter 3.

Script

Topic

Figure

plot_05_selection_schemes.py

Five selection schemes on one problem

3.2

   

plot_06_bloat_control.py

Bloat and its control

3.3

   

plot_07_parameter_optimization.py

Parameter optimization inside the search

3.4

   

plot_08_pareto_selection.py

The Pareto front and the choice of one model

3.5

   

plot_09_diversity.py

Diversity: semantic crossover and islands

3.6

   

plot_10_library_learning.py

Library learning: reusing building blocks (new in eqdisco)

3.7

   

C.3 Linear-in-parameters models, OLS and GP-OLS

Folder examples/03_gpols/. The methods are described in chapter 4.

Script

Topic

Figure

plot_11_ols_err.py

Orthogonal least squares and the error reduction ratio

4.2

   

plot_12_mggp.py

Multi-gene genetic programming

4.3

   

plot_13_gpols.py

GP-OLS: pruning terms by their error reduction ratio

4.4

   

plot_14_err_guided.py

ERR-guided variation: an experimental operator (new in eqdisco)

4.5

   

plot_15_cooperative.py

Cooperative GP with OLS credit assignment (new in eqdisco)

4.6

   

C.4 Sparse regression and deterministic search

Folder examples/04_sparse/. The methods are described in chapter 5.

Script

Topic

Figure

plot_16_sparse_library.py

Sparse regression over a library of terms

5.2

   

plot_17_ffx.py

Fast Function Extraction (FFX)

5.3

   

plot_18_exhaustive.py

Exhaustive search with a description length

5.4

   

C.5 Probabilistic and language-guided search

Folder examples/05_probabilistic/. The methods are described in chapter 6.

Script

Topic

Figure

plot_19_bayesian.py

Bayesian sampling of model structures

6.2

   

plot_20_grammar_ce.py

Learning a grammar of good expressions (new in eqdisco)

6.3

   

plot_21_llm_proposals.py

Language models as proposal generators

6.4

   

C.6 Dynamic systems

Folder examples/06_dynamics/. The methods are described in chapter 7.

Script

Topic

Figure

plot_22_narx_gpols.py

Nonlinear input–output identification with GP-OLS

7.2

   

plot_23_order_selection.py

Model order selection for NARX models

7.3

   

plot_24_sindy_lorenz.py

Sparse identification of the Lorenz system

7.4

   

plot_25_symbolic_ode.py

Differential equations by genetic programming

7.5

   

C.7 Beyond regression: classifiers and projections

Folder examples/07_beyond/. The methods are described in chapter 8.

Script

Topic

Figure

plot_26_runaway_classifier.py

A critical equation for reactor runaway

8.2

   

plot_27_goal_oriented_projection.py

Goal-oriented projection with symbolic features

8.3

   

plot_28_soft_sensor_projection.py

Symbolic features for a soft sensor

8.4

   

C.8 Domain knowledge

Folder examples/08_knowledge/. The methods are described in chapter 9.

Script

Topic

Figure

plot_29_units.py

Physical units: dimensional consistency and Buckingham groups

9.2

   

plot_30_shape_constraints.py

Shape constraints for safe extrapolation

9.3

   

plot_31_symmetry.py

Separability and symmetries detected from data

9.4

   

C.9 Analysis of discovered models

Folder examples/09_analysis/. The methods are described in chapter 10.

Script

Topic

Figure

plot_32_simplification.py

Simplification of evolved models

10.2

   

plot_33_validation_uncertainty.py

Validation and uncertainty of a discovered law

10.3

   

plot_34_sensitivity.py

Sensitivity analysis of a discovered model

10.4

   

plot_35_building_blocks.py

Building blocks and variable interactions

10.5

   

plot_36_model_families.py

Model families: how many different models do the data support? (new in eqdisco)

10.6

   

plot_37_ensemble.py

Bootstrap ensembles: model uncertainty and stable structure

10.7

   

C.10 From discovery to deployment

Folder examples/10_mlops/. The methods are described in chapter 11.

Script

Topic

Figure

plot_38_export.py

Exporting equations to code, spreadsheets and PMML

11.2

   

plot_39_registry_monitoring.py

Registry, model card and drift monitoring

11.3

   

plot_40_benchmark.py

A small benchmark of methods

11.4

   

plot_41_dashboard.py

A one-page report of a search

11.5