Utils
predict(model, x, y)
Maps independent variable data onto expected dependent variable data
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model |
Tree
|
The equation / function that best maps x onto y |
required |
x |
pd.DataFrame
|
The independent variables of the data |
required |
y |
pd.DataFrame
|
The dependent variable of the data |
required |
Source code in autora/theorist/bms/utils.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
present_results(model, model_len, desc_len)
Prints out the best equation, its description length, along with a plot of how this has progressed over the course of the search tasks
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model |
Tree
|
The equation which best describes the data |
required |
model_len |
float
|
The equation loss (defined as description length) |
required |
desc_len |
List[float]
|
Record of equation loss over time |
required |
Source code in autora/theorist/bms/utils.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
run(pms, num_steps, thinning=100)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pms |
Parallel
|
Parallel Machine Scientist (BMS is essentially a wrapper for pms) |
required |
num_steps |
int
|
number of epochs / mcmc step & tree swap iterations |
required |
thinning |
int
|
number of epochs between recording model loss to the trace |
100
|
Returns:
Name | Type | Description |
---|---|---|
model |
Tree
|
The equation which best describes the data |
model_len |
float
|
(defined as description length) loss function score |
desc_len |
List[float]
|
Record of loss function score over time |
Source code in autora/theorist/bms/utils.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|