|
QDpy
|
Compare MAP-Elites with aggregate and case-wise genetic programming. More...
Go to the source code of this file.
Classes | |
| class | qdpy.symbolic._search.SymbolicRegressionStats |
| Applied search budget and numerical evaluation counts. More... | |
| class | qdpy.symbolic._search.LinkedSymbolicRegressionStats |
| Count attempted and accepted linked changes in symbolic regression. More... | |
| class | qdpy.symbolic._search.SymbolicRegressionResult |
| Retained regression models and the native QD archive, if used. More... | |
| class | qdpy.symbolic._search._Grammar |
| class | qdpy.symbolic._search._TreeMixer |
| class | qdpy.symbolic._search._ModelPool |
| class | qdpy.symbolic._search._CasePool |
Namespaces | |
| namespace | qdpy |
Functions | |
| SymbolicRegressionResult | qdpy.symbolic._search.symbolic_regression (X, y, *, str mode="structural", probes=None, int budget=512, int max_depth=4, int max_nodes=13, int max_parameters=4, operators=_DEFAULT_OPERATORS, literals=(1., 2.), int cells=24, int population_size=24, bool passive_archive=False, nonlinear_bounds=(-20., 20.), int fit_evaluations=48, int fit_restarts=4, int|None seed=None, novelty_binner=None, int novelty_history=256, variation="subtree", max_fit_evaluations=None) |
| Search for equations using MAP-Elites or genetic programming. | |
Compare MAP-Elites with aggregate and case-wise genetic programming.
Definition in file _search.py.
| SymbolicRegressionResult qdpy.symbolic._search.symbolic_regression | ( | X, | |
| y, | |||
| * | , | ||
| str | mode = "structural", | ||
| probes = None, | |||
| int | budget = 512, | ||
| int | max_depth = 4, | ||
| int | max_nodes = 13, | ||
| int | max_parameters = 4, | ||
| operators = _DEFAULT_OPERATORS, | |||
| literals = (1., 2.), | |||
| int | cells = 24, | ||
| int | population_size = 24, | ||
| bool | passive_archive = False, | ||
| nonlinear_bounds = (-20., 20.), | |||
| int | fit_evaluations = 48, | ||
| int | fit_restarts = 4, | ||
| int | None | seed = None, | ||
| novelty_binner = None, | |||
| int | novelty_history = 256, | ||
| variation = "subtree", | |||
| max_fit_evaluations = None ) |
Search for equations using MAP-Elites or genetic programming.
| X | Finite training sample matrix. |
| y | One finite training target per row. |
| mode | Structural, semantic, gp, lexicase, epsilon-lexicase, or novelty-lexicase. |
| probes | Fixed unlabeled sample rows for feasibility and semantic descriptors. |
| budget | Number of proposed trees, including duplicates. |
| max_depth | Maximum number of edges from root to leaf. |
| max_nodes | Maximum number of operator and leaf occurrences in a tree. |
| max_parameters | Maximum number of coefficient leaves. |
| operators | Allowed Expression operations. |
| literals | Fixed numeric terminals in the grammar. |
| cells | Number of semantic archive centroids. |
| novelty_binner | Optional callable returning hashable groups for training predictions. |
| novelty_history | Maximum number of historical output rows used for novelty counts. |
| population_size | Maximum GP population size. |
| passive_archive | Collect a structural grid while GP selects by aggregate error. |
| nonlinear_bounds | Coefficient bounds for the nonlinear optimizer. |
| fit_evaluations | Training evaluation cap per unique structure. |
| fit_restarts | Number of nonlinear restarts per fit. |
| variation | Subtree, template-linkage, or learned-linkage variation. |
| max_fit_evaluations | Optional total budget for training-expression evaluations. |
| seed | Seed for variation, coefficient fitting, and archive geometry. |
Fit equations to one labeled training dataset. X has shape (samples, variables) and y has shape (samples,). Each proposal spends one unit of budget, including repeats. Search starts with the variable, literal, and free parameter terminals. Genetic variation uses the supplied operator names, at most max_depth edges, max_nodes nodes, and max_parameters free scalar leaves. Structural MAP-Elites uses node count, free coefficient count, and non-algebraic operator count. Semantic MAP-Elites uses one descriptor coordinate per unlabeled probe row. Predictions are compressed with arctangent at the training target scale, and cells defines the size of its CVT. GP retains population_size candidates by training RMSE. The lexicase modes use generations of population_size proposals and select parents on training cases. They collect a structural grid as a passive archive. Set passive_archive=True to collect the same grid alongside aggregate-error GP. Novelty-lexicase also selects on output rarity. By default it groups predictions in 16 fixed bins after arctangent compression using the training target scale. Pass novelty_binner to map a prediction vector to a sequence of hashable labels, one per training case. It keeps one sampled output row per completed generation, up to novelty_history. For structural or semantic MAP-Elites, template-linkage clusters homologous tree slots by distance in the template. Learned-linkage estimates their dependencies with a masked intron symbol. Both offer each fitted intermediate to the archive and continue the mix from changes that preserve or improve training error. Subtree remains the default. The optional total fit cap stops when fewer than two training evaluations remain. Supply probes with the same number of columns as X. If provided, candidates must give finite predictions on every probe in any mode. Nonlinear bounds, fit_evaluations, and fit_restarts configure coefficient fitting. Validation and test labels belong outside this call. The seed controls variation, fitting, and centroid generation.
Definition at line 349 of file _search.py.