StackGP 0.0.14__tar.gz → 0.0.15__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: StackGP
3
- Version: 0.0.14
3
+ Version: 0.0.15
4
4
  Summary: A stack-based genetic programming system
5
5
  Author-email: Nathan Haut <hautnath@msu.edu>
6
6
  Project-URL: Homepage, https://github.com/hoolagans/StackGP
@@ -24,6 +24,7 @@ try:
24
24
  from IPython.display import display, clear_output
25
25
  except:
26
26
  pass
27
+
27
28
  import signal #for timing out functions
28
29
  from contextlib import contextmanager #for timing out functions
29
30
 
@@ -63,6 +64,8 @@ def sqrd(a):
63
64
  return a**2
64
65
  def inv(a):
65
66
  return np.array(a).astype(float)**(-1)
67
+ def neg(a):
68
+ return -a
66
69
  def sin(a):
67
70
  return np.sin(a)
68
71
  def cos(a):
@@ -79,6 +82,12 @@ def tanh(a):
79
82
  return np.tanh(a)
80
83
  def log(a):
81
84
  return np.log(a)
85
+ def log10(a):
86
+ return np.log10(a)
87
+ def log2(a):
88
+ return np.log2(a)
89
+ def abs1(a):
90
+ return np.abs(a)
82
91
 
83
92
  def and1(a,b):
84
93
  return np.logical_and(a,b)
@@ -97,9 +106,9 @@ def not1(a):
97
106
 
98
107
 
99
108
  def defaultOps():
100
- return [protectDiv,add,sub,mult,exp,sqrd,sqrt,inv,"pop","pop","pop","pop","pop","pop"]
109
+ return [protectDiv,add,sub,mult,exp,sqrd,sqrt,inv,neg,"pop","pop","pop","pop","pop","pop"]
101
110
  def allOps():
102
- return [protectDiv,add,sub,mult,exp,sqrd,sqrt,inv,cos,sin,tan,arccos,arcsin,arctan,tanh,log,"pop","pop","pop","pop","pop","pop","pop","pop","pop","pop"]
111
+ return [protectDiv,add,sub,mult,exp,sqrd,sqrt,inv,neg,cos,sin,tan,arccos,arcsin,arctan,tanh,log,"pop","pop","pop","pop","pop","pop","pop","pop","pop","pop"]
103
112
  def booleanOps():
104
113
  return [and1,or1,xor1,nand1,nor1,xnor1,not1,"pop","pop","pop","pop","pop","pop","pop"]
105
114
  def randomInt(a=-3,b=3):
@@ -814,7 +823,10 @@ def printGPModel(mod,inputData=symbols(["x"+str(i) for i in range(100)])): #Eval
814
823
  model[0] = replaceFunc(model[0],arctan,atan)
815
824
  model[0] = replaceFunc(model[0],tanh,tanh1)
816
825
  model[0] = replaceFunc(model[0],log,log2)
817
- response=evModHelper(model[1],model[0],[],np.array(inputData))[2][0]
826
+ try:
827
+ response=evModHelper(model[1],model[0],[],np.array(inputData))[2][0]
828
+ except:
829
+ return np.nan
818
830
  return response
819
831
 
820
832
  def ensembleSelect(models, inputData, responseData, numberOfClusters=10): #Generates a model ensemble using input data partitions
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: StackGP
3
- Version: 0.0.14
3
+ Version: 0.0.15
4
4
  Summary: A stack-based genetic programming system
5
5
  Author-email: Nathan Haut <hautnath@msu.edu>
6
6
  Project-URL: Homepage, https://github.com/hoolagans/StackGP
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "StackGP"
3
- version = "0.0.14"
3
+ version = "0.0.15"
4
4
  authors = [
5
5
  { name="Nathan Haut", email="hautnath@msu.edu" },
6
6
  ]
File without changes
File without changes
File without changes
File without changes