Skip to content

Commit

Permalink
Merge pull request #25 from AutoResearch/add-standard-operators-and_f…
Browse files Browse the repository at this point in the history
…unctions

Add standard operators and functions
  • Loading branch information
younesStrittmatter authored Nov 2, 2023
2 parents 141814a + 7797f3e commit efa7415
Show file tree
Hide file tree
Showing 23 changed files with 1,087 additions and 154 deletions.
29 changes: 19 additions & 10 deletions README.md
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.
65 changes: 65 additions & 0 deletions dev/burn.py
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,
)
72 changes: 0 additions & 72 deletions docs/Additional Example.ipynb

This file was deleted.

Loading

0 comments on commit efa7415

Please sign in to comment.