pyeggp 1.0.0__cp310-cp310-win_amd64.whl → 1.0.1__cp310-cp310-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 CHANGED
@@ -107,14 +107,53 @@ class PyEGGP(BaseEstimator, RegressorMixin):
107
107
  self.is_fitted_ = True
108
108
  return self
109
109
 
110
+ def fit_mvsr(self, Xs, ys):
111
+ if Xs[0].ndim == 1:
112
+ Xs = [X.reshape(-1,1) for X in Xs]
113
+ ys = [y.reshape(-1, 1) for y in ys]
114
+ combineds = [np.hstack([X, y]) for X, y in zip(Xs, ys)]
115
+ header = [f"x{i}" for i in range(Xs[0].shape[1])] + ["y"]
116
+ datasets = []
117
+ for combined in combineds:
118
+ with tempfile.NamedTemporaryFile(mode='w+', newline='', delete=False, suffix='.csv') as temp_file:
119
+ writer = csv.writer(temp_file)
120
+ writer.writerow(header)
121
+ writer.writerows(combined)
122
+ datasets.append(temp_file.name)
123
+
124
+ csv_data = pyeggp_run(" ".join(datasets), self.gen, self.nPop, self.maxSize, self.nTournament, self.pc, self.pm, self.nonterminals, self.loss, self.optIter, self.optRepeat, self.nParams, self.split, self.simplify, self.dumpTo, self.loadFrom)
125
+ if len(csv_data) > 0:
126
+ csv_io = StringIO(csv_data.strip())
127
+ self.results = pd.read_csv(csv_io, header=0, dtype={'theta':str})
128
+ self.is_fitted_ = True
129
+ return self
130
+
110
131
  def predict(self, X):
111
132
  check_is_fitted(self)
112
- return self.evaluate_best_model(self.model_, X)
133
+ return self.evaluate_best_model(X)
134
+
135
+ def predict_mvsr(self, X, view):
136
+ check_is_fitted(self)
137
+ return self.evaluate_best_model_view(X, view)
138
+
113
139
  def evaluate_best_model(self, x):
114
140
  if x.ndim == 1:
115
141
  x = x.reshape(-1,1)
116
142
  t = np.array(list(map(float, self.results.iloc[-1].theta.split(";"))))
117
143
  return eval(self.results.iloc[-1].Numpy)
144
+ def evaluate_best_model_view(self, x, view):
145
+ if x.ndim == 1:
146
+ x = x.reshape(-1,1)
147
+ ix = self.results.iloc[-1].id
148
+ best = self.results[self.results.id==ix].iloc[view]
149
+ t = np.array(list(map(float, best.theta.split(";"))))
150
+ return eval(best.Numpy)
151
+ def evaluate_model_view(self, x, ix, view):
152
+ if x.ndim == 1:
153
+ x = x.reshape(-1,1)
154
+ best = self.results[self.results.id==ix].iloc[view]
155
+ t = np.array(list(map(float, best.theta.split(";"))))
156
+ return eval(best.Numpy)
118
157
  def evaluate_model(self, ix, x):
119
158
  if x.ndim == 1:
120
159
  x = x.reshape(-1,1)
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-08n10a1r\\cp310-win_amd64\\repaired_wheel', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-08n10a1r\\cp310-win_amd64\\built_wheel\\pyeggp-1.0.0-cp310-cp310-win_amd64.whl', '--add-path', 'C:\\nlopt\\bin']
2
+ Arguments: ['C:\\hostedtoolcache\\windows\\Python\\3.12.9\\x64\\Scripts\\delvewheel', 'repair', '-w', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-zhyu2oli\\cp310-win_amd64\\repaired_wheel', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-zhyu2oli\\cp310-win_amd64\\built_wheel\\pyeggp-1.0.1-cp310-cp310-win_amd64.whl', '--add-path', 'C:\\nlopt\\bin']
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyeggp
3
- Version: 1.0.0
3
+ Version: 1.0.1
4
4
  Summary: Python Wheels for eggp algorithm.
5
5
  Author-email: Fabricio Olivetti <folivetti@users.noreply.github.com>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -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.cp310-win_amd64.pyd,sha256=MXh_Wr01gPgQQe_n_LBg14HKoI2Rmh0l2o92zcUcv6U,40247296
4
+ pyeggp/_binding.cp310-win_amd64.pyd,sha256=3oUXA-6iY_K4s3bQcyRWHn51GUbu1kqYNlRccc5iWK4,40247296
5
5
  pyeggp/_binding.py,sha256=hCATypEr6IcQgGrz3TqFzOQ0gZKsqU5CL4UcyI3M6_Y,598
6
6
  pyeggp/_binding.pyi,sha256=tLpel6vl4zZ_mftC6zVaWVfV2zhVxDLIZpFQ3cisgH4,467
7
- pyeggp/__init__.py,sha256=aHV3duS7GP9P-CVgC0zyz5Vqk-rZXBfoNlfeQ-0E3j8,4461
7
+ pyeggp/__init__.py,sha256=SqZfmavLzkYXhY2ZZpc46WxrlZrw17e4ovPu5NtHgTc,6255
8
8
  pyeggp/__main__.py,sha256=b5xBNv5E7XRE2a2cCHvSYQvDTJ7i6SR2JuAvstvEaFE,166
9
- pyeggp-1.0.0.dist-info/DELVEWHEEL,sha256=DxdpCLZK4YKm-fuL4CrdALo4TMUPBSffX5JGWU9muE4,387
10
- pyeggp-1.0.0.dist-info/entry_points.txt,sha256=NJouaQ2UoCLBu7Toqer0FBvNSDYMawR_Wx9STMdopyY,48
11
- pyeggp-1.0.0.dist-info/METADATA,sha256=oJ8qCRB30pjV-qfOHr3WGv4nuIYNCtyv48ADJQEcKU8,42930
12
- pyeggp-1.0.0.dist-info/RECORD,,
13
- pyeggp-1.0.0.dist-info/top_level.txt,sha256=iLrWfWZHh4NruYDgVyn2ntEB-uJ8fIs95nzNVLIhKE4,7
14
- pyeggp-1.0.0.dist-info/WHEEL,sha256=xtqxYTqke_XhXNhgwydvlroVayIzBVjJDMBpIgge99s,101
15
- pyeggp-1.0.0.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
9
+ pyeggp-1.0.1.dist-info/DELVEWHEEL,sha256=3TUjZ-fFqOC3Xz2XrOZpdUWka0t9SPGrsDkhR44p3-8,387
10
+ pyeggp-1.0.1.dist-info/entry_points.txt,sha256=NJouaQ2UoCLBu7Toqer0FBvNSDYMawR_Wx9STMdopyY,48
11
+ pyeggp-1.0.1.dist-info/METADATA,sha256=wfKNMJ1kKfJART80WinVVLyFK2VbIzruzoFw4mkpDHs,42930
12
+ pyeggp-1.0.1.dist-info/RECORD,,
13
+ pyeggp-1.0.1.dist-info/top_level.txt,sha256=iLrWfWZHh4NruYDgVyn2ntEB-uJ8fIs95nzNVLIhKE4,7
14
+ pyeggp-1.0.1.dist-info/WHEEL,sha256=xtqxYTqke_XhXNhgwydvlroVayIzBVjJDMBpIgge99s,101
15
+ pyeggp-1.0.1.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-3a904c117411120733a50f72774207d3.dll,sha256=StQslv47yH5idXgBfe2DOcXgzH3Y5uPFBFuzeNUgk6E,749190
17
+ pyeggp.libs/libnlopt-b2a417291a17d7165e68e732209d21b7.dll,sha256=QvUMosCR0lNzg2Y5aRnDAI3AzCT4Xw_9tU7swrKkRa8,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
File without changes