MilesCranmer commited on
Commit
c7ce1c2
1 Parent(s): df022a0

Better defaults

Browse files
Files changed (1) hide show
  1. eureqa.py +18 -20
eureqa.py CHANGED
@@ -6,27 +6,25 @@ import numpy as np
6
  import pandas as pd
7
 
8
  # Dumped from hyperparam optimization
9
- default_alpha = 5.429178
10
- default_annealing = 1.000000
11
- default_fractionReplaced = 0.415076
12
- default_fractionReplacedHof = 0.031713
13
- default_ncyclesperiteration = 1614.000000
14
- default_niterations = 25.000000
15
- default_npop = 300.000000
16
- default_parsimony = 0.001861
17
- default_topn = 9.000000
18
- default_weightAddNode = 3.788920
19
- default_weightDeleteNode = 2.553399
20
- default_weightDoNothing = 0.498528
21
- default_weightMutateConstant = 2.081372
22
- default_weightMutateOperator = 2.003413
23
- default_weightRandomize = 4.679883
24
- default_weightSimplify = 0.009620
25
- default_result = -1.183938
26
 
27
  def eureqa(X=None, y=None, threads=4,
28
  niterations=20,
29
- ncyclesperiteration=int(default_ncyclesperiteration),
30
  binary_operators=["plus", "mult"],
31
  unary_operators=["cos", "exp", "sin"],
32
  alpha=default_alpha,
@@ -34,7 +32,7 @@ def eureqa(X=None, y=None, threads=4,
34
  fractionReplaced=default_fractionReplaced,
35
  fractionReplacedHof=default_fractionReplacedHof,
36
  npop=int(default_npop),
37
- parsimony=default_parsimony,
38
  migration=True,
39
  hofMigration=True,
40
  shouldOptimizeConstants=True,
@@ -199,7 +197,7 @@ if __name__ == "__main__":
199
  parser.add_argument("--maxsize", type=int, default=20, help="Max size of equation")
200
  parser.add_argument("--niterations", type=int, default=20, help="Number of total migration periods")
201
  parser.add_argument("--npop", type=int, default=int(default_npop), help="Number of members per population")
202
- parser.add_argument("--ncyclesperiteration", type=int, default=int(default_ncyclesperiteration), help="Number of evolutionary cycles per migration")
203
  parser.add_argument("--topn", type=int, default=int(default_topn), help="How many best species to distribute from each population")
204
  parser.add_argument("--fractionReplacedHof", type=float, default=default_fractionReplacedHof, help="Fraction of population to replace with hall of fame")
205
  parser.add_argument("--fractionReplaced", type=float, default=default_fractionReplaced, help="Fraction of population to replace with best from other populations")
 
6
  import pandas as pd
7
 
8
  # Dumped from hyperparam optimization
9
+ default_alpha = 3.861222
10
+ default_fractionReplaced = 0.057940
11
+ default_fractionReplacedHof = 0.206182
12
+ default_npop = 124.000000
13
+ default_weightAddNode = 1.599672
14
+ default_weightDeleteNode = 0.049554
15
+ default_weightMutateConstant = 5.295328
16
+ default_weightMutateOperator = 0.465999
17
+ default_weightRandomize = 0.184765
18
+ default_weightSimplify = 0.149432
19
+ default_weightDoNothing = 1.000000
20
+ default_result = 0.028084
21
+ default_topn = 10
22
+ default_parsimony = 1e-3
23
+
 
 
24
 
25
  def eureqa(X=None, y=None, threads=4,
26
  niterations=20,
27
+ ncyclesperiteration=10000,
28
  binary_operators=["plus", "mult"],
29
  unary_operators=["cos", "exp", "sin"],
30
  alpha=default_alpha,
 
32
  fractionReplaced=default_fractionReplaced,
33
  fractionReplacedHof=default_fractionReplacedHof,
34
  npop=int(default_npop),
35
+ parsimony=1e-3,
36
  migration=True,
37
  hofMigration=True,
38
  shouldOptimizeConstants=True,
 
197
  parser.add_argument("--maxsize", type=int, default=20, help="Max size of equation")
198
  parser.add_argument("--niterations", type=int, default=20, help="Number of total migration periods")
199
  parser.add_argument("--npop", type=int, default=int(default_npop), help="Number of members per population")
200
+ parser.add_argument("--ncyclesperiteration", type=int, default=10000, help="Number of evolutionary cycles per migration")
201
  parser.add_argument("--topn", type=int, default=int(default_topn), help="How many best species to distribute from each population")
202
  parser.add_argument("--fractionReplacedHof", type=float, default=default_fractionReplacedHof, help="Fraction of population to replace with hall of fame")
203
  parser.add_argument("--fractionReplaced", type=float, default=default_fractionReplaced, help="Fraction of population to replace with best from other populations")