-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from AutoResearch/add-standard-operators-and_f…
…unctions Add standard operators and functions
- Loading branch information
Showing
23 changed files
with
1,087 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,25 @@ | ||
# Quickstart Guide | ||
# Equation Tree | ||
|
||
You will need: | ||
The Equation Tree package is an equation toolbox with symbolic regression in mind. It represents | ||
expressions as incomplete binary trees and has various features tailored towards testing symbolic | ||
regression algorithms or training models. The main features are: | ||
|
||
- `python` 3.8 or greater: [https://www.python.org/downloads/](https://www.python.org/downloads/) | ||
- Equation sampling (including priors) | ||
- Feature Extraction from equation distributions | ||
- Distance metrics between equations | ||
|
||
|
||
```shell | ||
pip install -U equation-tree | ||
``` | ||
## Getting Started | ||
|
||
Check out the documentation at | ||
[https://autoresearch.github.io/equation-tree](https://autoresearch.github.io/equation-tree). | ||
|
||
Check your installation by running: | ||
```shell | ||
python -c "from equation_tree import EquationTree" | ||
``` | ||
## About | ||
|
||
This project is in active development by | ||
the <a href="https://musslick.github.io/AER_website/Research.html">Autonomous Empirical Research | ||
Group</a> | ||
(package developer: <a href="https://younesstrittmatter.github.io/">Younes Strittmatter</a>, | ||
PI: <a href="https://smusslick.com/">Sebastian Musslick</a>. This research program is supported by | ||
Schmidt Science Fellows, in partnership with the Rhodes Trust, as well as the Carney BRAINSTORM | ||
program at Brown University. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
from equation_tree.sample import burn | ||
from equation_tree.defaults import DEFAULT_PRIOR | ||
|
||
prior_0 = { | ||
'structures': {'[0, 1, 1]': .3, '[0, 1, 2]': .3, '[0, 1, 2, 3, 2, 3, 1]': .4}, | ||
'features': {'constants': .2, 'variables': .8}, | ||
'functions': {'sin': .5, 'cos': .5}, | ||
'operators': {'+': .8, '-': .2} | ||
} | ||
|
||
|
||
|
||
prior_1 = { | ||
'structures': {'[0, 1, 1]': .3, '[0, 1, 2]': .3, '[0, 1, 2, 3, 2, 3, 1]': .4}, | ||
'features': {'constants': .2, 'variables': .8}, | ||
'functions': {'sin': .5, 'cos': .5}, | ||
'operators': {'+': .5, '-': .5}, | ||
'function_conditionals': { | ||
'sin': { | ||
'features': {'constants': 0., 'variables': 1.}, | ||
'functions': {'sin': 0., 'cos': 1.}, | ||
'operators': {'+': .5, '-': .5} | ||
}, | ||
'cos': { | ||
'features': {'constants': 0., 'variables': 1.}, | ||
'functions': {'cos': 1., 'sin': 0.}, | ||
'operators': {'+': 0., '-': 1.} | ||
} | ||
}, | ||
'operator_conditionals': { | ||
'+': { | ||
'features': {'constants': .5, 'variables': .5}, | ||
'functions': {'sin': 1., 'cos': 0.}, | ||
'operators': {'+': 1., '-': 0.} | ||
}, | ||
'-': { | ||
'features': {'constants': .3, 'variables': .7}, | ||
'functions': {'cos': .5, 'sin': .5}, | ||
'operators': {'+': .9, '-': .1} | ||
} | ||
}, | ||
} | ||
|
||
# import random | ||
for _ in range(1, 5): | ||
burn(DEFAULT_PRIOR, | ||
_, | ||
"../src/equation_tree/data/_hashed_probabilities.json", | ||
10_000, | ||
0.5, | ||
) | ||
burn( | ||
prior_0, | ||
2, | ||
"../src/equation_tree/data/_hashed_probabilities.json", | ||
10_000, | ||
0.5, | ||
) | ||
burn( | ||
prior_1, | ||
2, | ||
"../src/equation_tree/data/_hashed_probabilities.json", | ||
10_000, | ||
0.5, | ||
) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.