Feynman
SRToolkit.dataset.feynman
Feynman symbolic regression benchmark.
Feynman
Bases: SR_benchmark
The Feynman symbolic regression benchmark.
Contains 100 physics equations with up to 9 variables. Data is downloaded on first use from the SymbolicRegressionToolkit repository (10,000 samples per dataset instead of the original 1,000,000 from the paper).
For more information about the Feynman benchmark, see: https://doi.org/10.1126/sciadv.aay2631
Examples:
>>> benchmark = Feynman()
>>> len(benchmark.list_datasets(verbose=False))
100
>>> X, y = benchmark.resample('I.16.6', n=500, seed=0)
>>> X.shape
(500, 3)
>>> y.shape
(500,)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset_directory
|
str
|
Directory where dataset files are stored or will be downloaded to.
Defaults to the platform-appropriate user data directory (e.g. |
join(user_data_dir('SRToolkit'), 'feynman')
|
Source code in SRToolkit/dataset/feynman.py
resample
Generate fresh data for a dataset by sampling new inputs and evaluating the ground truth.
Variable bounds are taken from _BOUNDS.
Examples:
>>> benchmark = Feynman()
>>> X, y = benchmark.resample('I.16.6', n=200, seed=42)
>>> X.shape
(200, 3)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset_name
|
str
|
Name of the dataset to resample. |
required |
n
|
int
|
Number of new samples to generate. |
required |
seed
|
Optional[int]
|
Random seed for reproducibility. |
None
|
Returns:
| Type | Description |
|---|---|
Tuple[ndarray, ndarray]
|
A tuple |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the dataset has no ground truth expression. |