pyeggp 1.0.1__cp313-cp313-win_amd64.whl → 1.0.3__cp313-cp313-win_amd64.whl
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.
- pyeggp/__init__.py +23 -0
- pyeggp/_binding.cp313-win_amd64.pyd +0 -0
- {pyeggp-1.0.1.dist-info → pyeggp-1.0.3.dist-info}/DELVEWHEEL +1 -1
- {pyeggp-1.0.1.dist-info → pyeggp-1.0.3.dist-info}/METADATA +1 -1
- {pyeggp-1.0.1.dist-info → pyeggp-1.0.3.dist-info}/RECORD +10 -10
- pyeggp.libs/{libnlopt-b2a417291a17d7165e68e732209d21b7.dll → libnlopt-810c2780d280c15810de7e03927423a0.dll} +0 -0
- {pyeggp-1.0.1.dist-info → pyeggp-1.0.3.dist-info}/WHEEL +0 -0
- {pyeggp-1.0.1.dist-info → pyeggp-1.0.3.dist-info}/entry_points.txt +0 -0
- {pyeggp-1.0.1.dist-info → pyeggp-1.0.3.dist-info}/licenses/LICENSE +0 -0
- {pyeggp-1.0.1.dist-info → pyeggp-1.0.3.dist-info}/top_level.txt +0 -0
pyeggp/__init__.py
CHANGED
@@ -13,6 +13,7 @@ import atexit
|
|
13
13
|
from contextlib import contextmanager
|
14
14
|
from threading import Lock
|
15
15
|
from typing import Iterator, List
|
16
|
+
import string
|
16
17
|
from io import StringIO
|
17
18
|
import tempfile
|
18
19
|
import csv
|
@@ -69,6 +70,11 @@ def pyeggp_run(dataset: str, gen: int, nPop: int, maxSize: int, nTournament: int
|
|
69
70
|
with hs_rts_init():
|
70
71
|
return unsafe_hs_pyeggp_run(dataset, gen, nPop, maxSize, nTournament, pc, pm, nonterminals, loss, optIter, optRepeat, nParams, split, simplify, dumpTo, loadFrom)
|
71
72
|
|
73
|
+
def make_function(expression):
|
74
|
+
def func(x, t):
|
75
|
+
return eval(expression)
|
76
|
+
return func
|
77
|
+
|
72
78
|
class PyEGGP(BaseEstimator, RegressorMixin):
|
73
79
|
def __init__(self, gen = 100, nPop = 100, maxSize = 15, nTournament = 3, pc = 0.9, pm = 0.3, nonterminals = "add,sub,mul,div", loss = "MSE", optIter = 50, optRepeat = 2, nParams = -1, split = 1, simplify = False, dumpTo = "", loadFrom = ""):
|
74
80
|
self.gen = gen
|
@@ -148,6 +154,7 @@ class PyEGGP(BaseEstimator, RegressorMixin):
|
|
148
154
|
best = self.results[self.results.id==ix].iloc[view]
|
149
155
|
t = np.array(list(map(float, best.theta.split(";"))))
|
150
156
|
return eval(best.Numpy)
|
157
|
+
|
151
158
|
def evaluate_model_view(self, x, ix, view):
|
152
159
|
if x.ndim == 1:
|
153
160
|
x = x.reshape(-1,1)
|
@@ -162,3 +169,19 @@ class PyEGGP(BaseEstimator, RegressorMixin):
|
|
162
169
|
def score(self, X, y):
|
163
170
|
ypred = self.evaluate_best_model(X)
|
164
171
|
return r2_score(y, ypred)
|
172
|
+
def get_model(self, idx):
|
173
|
+
alphabet = list(string.ascii_uppercase)
|
174
|
+
row = self.results[self.results['id']==idx].iloc[0]
|
175
|
+
visual_expression = row['Numpy']
|
176
|
+
model = make_function(visual_expression)
|
177
|
+
n_params_used = len(row['theta'].split(sep=';'))
|
178
|
+
|
179
|
+
# Works for solutions with less than 26 parameters
|
180
|
+
for i in range(n_params_used):
|
181
|
+
visual_expression = visual_expression.replace(f't[{i}]', alphabet[i])
|
182
|
+
|
183
|
+
# Works for data with less than 50 dimensions
|
184
|
+
for i in range(50):
|
185
|
+
visual_expression = visual_expression.replace(f'x[:, {i}]', f'X{i}')
|
186
|
+
|
187
|
+
return model, visual_expression
|
Binary file
|
@@ -1,2 +1,2 @@
|
|
1
1
|
Version: 1.10.0
|
2
|
-
Arguments: ['C:\\hostedtoolcache\\windows\\Python\\3.12.9\\x64\\Scripts\\delvewheel', 'repair', '-w', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-
|
2
|
+
Arguments: ['C:\\hostedtoolcache\\windows\\Python\\3.12.9\\x64\\Scripts\\delvewheel', 'repair', '-w', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-qm6p78zx\\cp313-win_amd64\\repaired_wheel', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-qm6p78zx\\cp313-win_amd64\\built_wheel\\pyeggp-1.0.3-cp313-cp313-win_amd64.whl', '--add-path', 'C:\\nlopt\\bin']
|
@@ -1,19 +1,19 @@
|
|
1
1
|
pyeggp/binding.i,sha256=UvqL1SWs47LNCpgN3F6l3oufPvwaqUzdHpk0cEZQa5M,1972
|
2
2
|
pyeggp/binding.py,sha256=EhVDh4fL2Zs7erIc8YmMq8Z3VW256E2dkKdPpaprMq8,2701
|
3
3
|
pyeggp/typing.py,sha256=aVUeV85Ig86cccHbyV1KDWjp_ioTl6z3omPA2ZPk0-4,531
|
4
|
-
pyeggp/_binding.cp313-win_amd64.pyd,sha256=
|
4
|
+
pyeggp/_binding.cp313-win_amd64.pyd,sha256=70pmCufhfwIFvhsp-kyp-UpyTXsw9sOX5CpMd17-Az0,40250368
|
5
5
|
pyeggp/_binding.py,sha256=R-QvYZGKBqs0QsuDZt-nJ6kouoNmwj-Qv9QSnG5r3eg,598
|
6
6
|
pyeggp/_binding.pyi,sha256=tLpel6vl4zZ_mftC6zVaWVfV2zhVxDLIZpFQ3cisgH4,467
|
7
|
-
pyeggp/__init__.py,sha256=
|
7
|
+
pyeggp/__init__.py,sha256=xsar2BYlW2mi1lFA48FYvCDut_MWUcY_EVKlkodCc6Q,7076
|
8
8
|
pyeggp/__main__.py,sha256=b5xBNv5E7XRE2a2cCHvSYQvDTJ7i6SR2JuAvstvEaFE,166
|
9
|
-
pyeggp-1.0.
|
10
|
-
pyeggp-1.0.
|
11
|
-
pyeggp-1.0.
|
12
|
-
pyeggp-1.0.
|
13
|
-
pyeggp-1.0.
|
14
|
-
pyeggp-1.0.
|
15
|
-
pyeggp-1.0.
|
9
|
+
pyeggp-1.0.3.dist-info/DELVEWHEEL,sha256=obcetEBbnSk94jOs7VL0peLg9Ji3XEuLvF5f6tNqUTo,387
|
10
|
+
pyeggp-1.0.3.dist-info/entry_points.txt,sha256=NJouaQ2UoCLBu7Toqer0FBvNSDYMawR_Wx9STMdopyY,48
|
11
|
+
pyeggp-1.0.3.dist-info/METADATA,sha256=uWz6ft4wZxQewFJiLd012SN4JGlI96Rmz2Cy7u5EAtc,42930
|
12
|
+
pyeggp-1.0.3.dist-info/RECORD,,
|
13
|
+
pyeggp-1.0.3.dist-info/top_level.txt,sha256=iLrWfWZHh4NruYDgVyn2ntEB-uJ8fIs95nzNVLIhKE4,7
|
14
|
+
pyeggp-1.0.3.dist-info/WHEEL,sha256=6WoW_bHwIgUwfRGomr3tsp2x5B1WboZF1vodYe1_93Y,101
|
15
|
+
pyeggp-1.0.3.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
|
16
16
|
pyeggp.libs/libgcc_s_seh-1-c7e71e753d95ee0b157469f5daa29a03.dll,sha256=OaympRU538qibFmFvn4Gt-RCKJiOQeGMApqEFl7_fKY,101376
|
17
|
-
pyeggp.libs/libnlopt-
|
17
|
+
pyeggp.libs/libnlopt-810c2780d280c15810de7e03927423a0.dll,sha256=uCYSNw5_nTmFKD3tWiW1xLIY_BuRaaBNcYBRZIBUYtU,749190
|
18
18
|
pyeggp.libs/libstdc++-6-a07611cfa5f65b02dbc1ace58f4dc030.dll,sha256=F4uaDJoJUOIf4DY3GuDR8SWay0W_LEel8SY8zJYod-k,2020352
|
19
19
|
pyeggp.libs/libwinpthread-1-2db4a17751d27a5781b70c35799daa95.dll,sha256=4BuOhf1nwrhh9k1MzH32B1m1iapBAACij6K4SiCJF1s,54784
|
index 331bfed..309ac49 100644
|
|
Binary file
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|