psyke 0.8.6.dev2__tar.gz → 0.8.7__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.
Potentially problematic release.
This version of psyke might be problematic. Click here for more details.
- {psyke-0.8.6.dev2/psyke.egg-info → psyke-0.8.7}/PKG-INFO +1 -1
- psyke-0.8.7/VERSION +1 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/__init__.py +4 -3
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/extraction/hypercubic/iter/__init__.py +8 -2
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/schema/__init__.py +161 -11
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/tuning/pedro/__init__.py +4 -3
- {psyke-0.8.6.dev2 → psyke-0.8.7/psyke.egg-info}/PKG-INFO +1 -1
- psyke-0.8.6.dev2/VERSION +0 -1
- {psyke-0.8.6.dev2 → psyke-0.8.7}/LICENSE +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/MANIFEST.in +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/README.md +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/clustering/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/clustering/cream/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/clustering/exact/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/clustering/utils.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/extraction/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/extraction/cart/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/extraction/cart/predictor.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/extraction/hypercubic/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/extraction/hypercubic/cosmik/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/extraction/hypercubic/creepy/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/extraction/hypercubic/divine/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/extraction/hypercubic/gridex/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/extraction/hypercubic/gridrex/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/extraction/hypercubic/hex/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/extraction/hypercubic/hypercube.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/extraction/hypercubic/strategy.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/extraction/hypercubic/utils.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/extraction/real/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/extraction/real/utils.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/extraction/trepan/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/extraction/trepan/utils.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/hypercubepredictor.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/tuning/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/tuning/crash/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/tuning/orchid/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/utils/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/utils/dataframe.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/utils/logic.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/utils/metrics.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/utils/plot.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke/utils/sorted.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke.egg-info/SOURCES.txt +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke.egg-info/dependency_links.txt +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke.egg-info/not-zip-safe +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke.egg-info/requires.txt +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/psyke.egg-info/top_level.txt +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/pyproject.toml +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/setup.cfg +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/setup.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/test/psyke/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/test/psyke/clustering/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/test/psyke/extraction/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/test/psyke/extraction/cart/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/test/psyke/extraction/cart/test_cart.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/test/psyke/extraction/cart/test_simplified_cart.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/test/psyke/extraction/hypercubic/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/test/psyke/extraction/hypercubic/gridex/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/test/psyke/extraction/hypercubic/gridex/test_gridex.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/test/psyke/extraction/hypercubic/iter/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/test/psyke/extraction/hypercubic/iter/test_iter.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/test/psyke/extraction/hypercubic/test_hypercube.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/test/psyke/extraction/real/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/test/psyke/extraction/real/test_real.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/test/psyke/extraction/real/test_rule.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/test/psyke/extraction/trepan/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/test/psyke/extraction/trepan/test_node.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/test/psyke/extraction/trepan/test_split.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/test/psyke/extraction/trepan/test_trepan.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/test/psyke/utils/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/test/psyke/utils/test_prune.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/test/psyke/utils/test_simplify.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/test/psyke/utils/test_simplify_formatter.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/test/resources/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/test/resources/datasets/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/test/resources/predictors/__init__.py +0 -0
- {psyke-0.8.6.dev2 → psyke-0.8.7}/test/resources/tests/__init__.py +0 -0
psyke-0.8.7/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.8.7
|
|
@@ -289,14 +289,15 @@ class Extractor(EvaluableModel, ABC):
|
|
|
289
289
|
|
|
290
290
|
@staticmethod
|
|
291
291
|
def iter(predictor, min_update: float = 0.1, n_points: int = 1, max_iterations: int = 600, min_examples: int = 250,
|
|
292
|
-
threshold: float = 0.1, fill_gaps: bool = True,
|
|
293
|
-
|
|
292
|
+
threshold: float = 0.1, fill_gaps: bool = True, ignore_dimensions=None,
|
|
293
|
+
normalization: dict[str, tuple[float, float]] = None, output=None,
|
|
294
|
+
seed: int = get_default_random_seed()) -> Extractor:
|
|
294
295
|
"""
|
|
295
296
|
Creates a new ITER extractor.
|
|
296
297
|
"""
|
|
297
298
|
from psyke.extraction.hypercubic.iter import ITER
|
|
298
299
|
return ITER(predictor, min_update, n_points, max_iterations, min_examples, threshold, fill_gaps,
|
|
299
|
-
normalization, output, seed)
|
|
300
|
+
ignore_dimensions, normalization, output, seed)
|
|
300
301
|
|
|
301
302
|
@staticmethod
|
|
302
303
|
def gridex(predictor, grid, min_examples: int = 250, threshold: float = 0.1, output: Target = Target.CONSTANT,
|
|
@@ -16,8 +16,9 @@ class ITER(HyperCubeExtractor):
|
|
|
16
16
|
"""
|
|
17
17
|
|
|
18
18
|
def __init__(self, predictor, min_update, n_points, max_iterations, min_examples, threshold, fill_gaps,
|
|
19
|
-
normalization, output: Target = Target.CONSTANT,
|
|
20
|
-
|
|
19
|
+
ignore_dimensions: Iterable, normalization, output: Target = Target.CONSTANT,
|
|
20
|
+
seed=get_default_random_seed()):
|
|
21
|
+
super().__init__(predictor, output, normalization=normalization)
|
|
21
22
|
if output is Target.REGRESSION:
|
|
22
23
|
raise NotImplementedError
|
|
23
24
|
self.predictor = predictor
|
|
@@ -30,6 +31,7 @@ class ITER(HyperCubeExtractor):
|
|
|
30
31
|
self._output = Target.CLASSIFICATION if isinstance(predictor, ClassifierMixin) else \
|
|
31
32
|
output if output is not None else Target.CONSTANT
|
|
32
33
|
self.seed = seed
|
|
34
|
+
self.ignore_dimensions = ignore_dimensions if ignore_dimensions is not None else []
|
|
33
35
|
|
|
34
36
|
def _best_cube(self, dataframe: pd.DataFrame, cube: GenericCube, cubes: Iterable[Expansion]) -> Expansion | None:
|
|
35
37
|
expansions = []
|
|
@@ -74,6 +76,8 @@ class ITER(HyperCubeExtractor):
|
|
|
74
76
|
hypercubes: Iterable[GenericCube]) -> Iterable[Expansion]:
|
|
75
77
|
tmp_cubes = []
|
|
76
78
|
for feature in self._surrounding.dimensions.keys():
|
|
79
|
+
if feature in self.ignore_dimensions:
|
|
80
|
+
continue
|
|
77
81
|
limit = cube.check_limits(feature)
|
|
78
82
|
if limit == '*':
|
|
79
83
|
continue
|
|
@@ -132,6 +136,8 @@ class ITER(HyperCubeExtractor):
|
|
|
132
136
|
hypercubes = self._generate_starting_points(dataframe)
|
|
133
137
|
for hypercube in hypercubes:
|
|
134
138
|
hypercube.expand_all(min_updates, self._surrounding)
|
|
139
|
+
for d in self.ignore_dimensions:
|
|
140
|
+
hypercube[d] = self._surrounding[d]
|
|
135
141
|
self.n_points = self.n_points - 1
|
|
136
142
|
if not HyperCube.check_overlap(hypercubes, hypercubes):
|
|
137
143
|
break
|
|
@@ -9,9 +9,15 @@ _EMPTY_INTERSECTION_EXCEPTION: Callable = lambda x, y: \
|
|
|
9
9
|
_NOT_IMPLEMENTED_INTERSECTION: Callable = lambda x, y: \
|
|
10
10
|
Exception("Not implemented intersection between: " + str(x) + ' and ' + str(y))
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
_OPERATION_WITH_WRONG_TYPE: Callable = lambda x, y: \
|
|
13
13
|
Exception("Calling method with wrong type argument: " + str(x) + ' and ' + str(y))
|
|
14
14
|
|
|
15
|
+
_EMPTY_UNION_EXCEPTION: Callable = lambda x, y: \
|
|
16
|
+
Exception(f"Empty union between two Value: {str(x)} and {str(y)}")
|
|
17
|
+
|
|
18
|
+
_NOT_IMPLEMENTED_UNION: Callable = lambda x, y: \
|
|
19
|
+
Exception("Not implemented union between: " + str(x) + ' and ' + str(y))
|
|
20
|
+
|
|
15
21
|
PRECISION = get_int_precision()
|
|
16
22
|
STRING_PRECISION = str(PRECISION)
|
|
17
23
|
|
|
@@ -109,7 +115,7 @@ class Value:
|
|
|
109
115
|
else:
|
|
110
116
|
raise _EMPTY_INTERSECTION_EXCEPTION(first_value, second_value)
|
|
111
117
|
else:
|
|
112
|
-
raise
|
|
118
|
+
raise _OPERATION_WITH_WRONG_TYPE(first_value, second_value)
|
|
113
119
|
|
|
114
120
|
def intersection_with_outside(first_value: Outside, second_value: Value) -> Value:
|
|
115
121
|
if isinstance(first_value, Outside):
|
|
@@ -154,9 +160,9 @@ class Value:
|
|
|
154
160
|
elif isinstance(second_value, Constant):
|
|
155
161
|
return intersection_with_constant(second_value, first_value)
|
|
156
162
|
else:
|
|
157
|
-
raise
|
|
163
|
+
raise _OPERATION_WITH_WRONG_TYPE(first_value, second_value)
|
|
158
164
|
else:
|
|
159
|
-
raise
|
|
165
|
+
raise _OPERATION_WITH_WRONG_TYPE(first_value, second_value)
|
|
160
166
|
|
|
161
167
|
def intersection_with_between(first_value: Between, second_value: Value) -> Value:
|
|
162
168
|
if isinstance(first_value, Between):
|
|
@@ -194,9 +200,9 @@ class Value:
|
|
|
194
200
|
elif isinstance(second_value, Outside):
|
|
195
201
|
return intersection_with_outside(second_value, first_value)
|
|
196
202
|
else:
|
|
197
|
-
raise
|
|
203
|
+
raise _OPERATION_WITH_WRONG_TYPE(first_value, second_value)
|
|
198
204
|
else:
|
|
199
|
-
raise
|
|
205
|
+
raise _OPERATION_WITH_WRONG_TYPE(first_value, second_value)
|
|
200
206
|
|
|
201
207
|
def intersection_with_less_than(first_value: LessThan, second_value: Value) -> Value:
|
|
202
208
|
if isinstance(first_value, LessThan):
|
|
@@ -214,9 +220,9 @@ class Value:
|
|
|
214
220
|
elif isinstance(second_value, Between):
|
|
215
221
|
return intersection_with_between(second_value, first_value)
|
|
216
222
|
else:
|
|
217
|
-
raise
|
|
223
|
+
raise _OPERATION_WITH_WRONG_TYPE(first_value, second_value)
|
|
218
224
|
else:
|
|
219
|
-
raise
|
|
225
|
+
raise _OPERATION_WITH_WRONG_TYPE(first_value, second_value)
|
|
220
226
|
|
|
221
227
|
def intersection_with_greater_than(first_value: GreaterThan, second_value: Value) -> Value:
|
|
222
228
|
if isinstance(first_value, GreaterThan):
|
|
@@ -231,9 +237,9 @@ class Value:
|
|
|
231
237
|
elif isinstance(second_value, LessThan):
|
|
232
238
|
return intersection_with_less_than(second_value, first_value)
|
|
233
239
|
else:
|
|
234
|
-
raise
|
|
240
|
+
raise _OPERATION_WITH_WRONG_TYPE(first_value, second_value)
|
|
235
241
|
else:
|
|
236
|
-
raise
|
|
242
|
+
raise _OPERATION_WITH_WRONG_TYPE(first_value, second_value)
|
|
237
243
|
|
|
238
244
|
if other is None:
|
|
239
245
|
return self
|
|
@@ -248,7 +254,151 @@ class Value:
|
|
|
248
254
|
elif isinstance(self, GreaterThan):
|
|
249
255
|
return intersection_with_greater_than(self, other)
|
|
250
256
|
else:
|
|
251
|
-
raise
|
|
257
|
+
raise _OPERATION_WITH_WRONG_TYPE(self, other)
|
|
258
|
+
|
|
259
|
+
def __add__(self, other) -> Value:
|
|
260
|
+
|
|
261
|
+
def union_with_constant(first_value: Constant, second_value: Value) -> Value:
|
|
262
|
+
if isinstance(first_value, Constant):
|
|
263
|
+
if first_value in second_value:
|
|
264
|
+
return second_value
|
|
265
|
+
else:
|
|
266
|
+
raise _NOT_IMPLEMENTED_UNION(first_value, second_value)
|
|
267
|
+
else:
|
|
268
|
+
raise _OPERATION_WITH_WRONG_TYPE(first_value, second_value)
|
|
269
|
+
|
|
270
|
+
def union_with_outside(first_value: Outside, second_value: Value) -> Value:
|
|
271
|
+
if isinstance(first_value, Outside):
|
|
272
|
+
if isinstance(second_value, LessThan):
|
|
273
|
+
if second_value.value > first_value.upper:
|
|
274
|
+
return Between(-math.inf, math.inf)
|
|
275
|
+
elif second_value.value > first_value.lower:
|
|
276
|
+
return Outside(second_value.value, first_value.upper)
|
|
277
|
+
else:
|
|
278
|
+
return first_value
|
|
279
|
+
elif isinstance(second_value, GreaterThan):
|
|
280
|
+
if second_value.value < first_value.lower:
|
|
281
|
+
return Between(-math.inf, math.inf)
|
|
282
|
+
elif second_value.value < first_value.upper:
|
|
283
|
+
return Outside(first_value.lower, second_value.value)
|
|
284
|
+
else:
|
|
285
|
+
return first_value
|
|
286
|
+
elif isinstance(second_value, Between):
|
|
287
|
+
if second_value.upper <= first_value.lower or second_value.lower >= first_value.upper:
|
|
288
|
+
return first_value
|
|
289
|
+
elif second_value.lower <= first_value.lower <= second_value.upper <= first_value.upper:
|
|
290
|
+
return Outside(second_value.upper, first_value.lower)
|
|
291
|
+
elif first_value.lower <= second_value.lower <= first_value.upper <= second_value.upper:
|
|
292
|
+
return Outside(first_value.upper, second_value.lower)
|
|
293
|
+
elif second_value.lower <= first_value.lower <= first_value.upper <= second_value.upper:
|
|
294
|
+
return Between(-math.inf, math.inf)
|
|
295
|
+
else:
|
|
296
|
+
raise _NOT_IMPLEMENTED_UNION(first_value, second_value)
|
|
297
|
+
elif isinstance(second_value, Outside):
|
|
298
|
+
if second_value.lower <= first_value.lower <= first_value.upper <= second_value.upper:
|
|
299
|
+
return first_value
|
|
300
|
+
elif first_value.lower <= second_value.lower <= second_value.upper <= first_value.upper:
|
|
301
|
+
return second_value
|
|
302
|
+
elif second_value.lower <= first_value.lower <= second_value.upper <= first_value.upper:
|
|
303
|
+
return Outside(first_value.lower, second_value.upper)
|
|
304
|
+
elif first_value.lower <= second_value.lower <= first_value.upper <= second_value.upper:
|
|
305
|
+
return Outside(second_value.lower, first_value.upper)
|
|
306
|
+
else:
|
|
307
|
+
return Between(-math.inf, math.inf)
|
|
308
|
+
elif isinstance(second_value, Constant):
|
|
309
|
+
return union_with_constant(second_value, first_value)
|
|
310
|
+
else:
|
|
311
|
+
raise _OPERATION_WITH_WRONG_TYPE(first_value, second_value)
|
|
312
|
+
else:
|
|
313
|
+
raise _OPERATION_WITH_WRONG_TYPE(first_value, second_value)
|
|
314
|
+
|
|
315
|
+
def union_with_between(first_value: Between, second_value: Value) -> Value:
|
|
316
|
+
if isinstance(first_value, Between):
|
|
317
|
+
if isinstance(second_value, LessThan):
|
|
318
|
+
if second_value.value <= first_value.lower:
|
|
319
|
+
raise _NOT_IMPLEMENTED_UNION(first_value, second_value)
|
|
320
|
+
elif first_value.lower <= second_value.value <= first_value.upper:
|
|
321
|
+
return LessThan(first_value.upper)
|
|
322
|
+
else:
|
|
323
|
+
return second_value
|
|
324
|
+
elif isinstance(second_value, GreaterThan):
|
|
325
|
+
if second_value.value <= first_value.lower:
|
|
326
|
+
return second_value
|
|
327
|
+
elif first_value.lower <= second_value.value <= first_value.upper:
|
|
328
|
+
return GreaterThan(first_value.lower)
|
|
329
|
+
else:
|
|
330
|
+
raise _NOT_IMPLEMENTED_UNION(first_value, second_value)
|
|
331
|
+
elif isinstance(second_value, Between):
|
|
332
|
+
if second_value in first_value:
|
|
333
|
+
return first_value
|
|
334
|
+
elif first_value in second_value:
|
|
335
|
+
return second_value
|
|
336
|
+
elif first_value.lower <= second_value.lower <= first_value.upper:
|
|
337
|
+
return Between(first_value.lower, second_value.upper)
|
|
338
|
+
elif second_value.lower <= first_value.lower <= second_value.upper <= first_value.upper:
|
|
339
|
+
return Between(second_value.lower, first_value.upper)
|
|
340
|
+
else:
|
|
341
|
+
raise _NOT_IMPLEMENTED_UNION(first_value, second_value)
|
|
342
|
+
elif isinstance(second_value, Constant):
|
|
343
|
+
return union_with_constant(second_value, first_value)
|
|
344
|
+
elif isinstance(second_value, Outside):
|
|
345
|
+
return union_with_outside(second_value, first_value)
|
|
346
|
+
else:
|
|
347
|
+
raise _OPERATION_WITH_WRONG_TYPE(first_value, second_value)
|
|
348
|
+
else:
|
|
349
|
+
raise _OPERATION_WITH_WRONG_TYPE(first_value, second_value)
|
|
350
|
+
|
|
351
|
+
def union_with_less_than(first_value: LessThan, second_value: Value) -> Value:
|
|
352
|
+
if isinstance(first_value, LessThan):
|
|
353
|
+
if isinstance(second_value, LessThan):
|
|
354
|
+
return second_value if first_value in second_value else first_value
|
|
355
|
+
elif isinstance(second_value, GreaterThan):
|
|
356
|
+
if second_value.value <= first_value.value:
|
|
357
|
+
return Between(-math.inf, math.inf)
|
|
358
|
+
else:
|
|
359
|
+
return Outside(first_value.value, second_value.value)
|
|
360
|
+
elif isinstance(second_value, Constant):
|
|
361
|
+
return union_with_constant(second_value, first_value)
|
|
362
|
+
elif isinstance(second_value, Outside):
|
|
363
|
+
return union_with_outside(second_value, first_value)
|
|
364
|
+
elif isinstance(second_value, Between):
|
|
365
|
+
return union_with_between(second_value, first_value)
|
|
366
|
+
else:
|
|
367
|
+
raise _OPERATION_WITH_WRONG_TYPE(first_value, second_value)
|
|
368
|
+
else:
|
|
369
|
+
raise _OPERATION_WITH_WRONG_TYPE(first_value, second_value)
|
|
370
|
+
|
|
371
|
+
def union_with_greater_than(first_value: GreaterThan, second_value: Value) -> Value:
|
|
372
|
+
if isinstance(first_value, GreaterThan):
|
|
373
|
+
if isinstance(second_value, GreaterThan):
|
|
374
|
+
return second_value if first_value in second_value else first_value
|
|
375
|
+
elif isinstance(second_value, Constant):
|
|
376
|
+
return union_with_constant(second_value, first_value)
|
|
377
|
+
elif isinstance(second_value, Outside):
|
|
378
|
+
return union_with_outside(second_value, first_value)
|
|
379
|
+
elif isinstance(second_value, Between):
|
|
380
|
+
return union_with_between(second_value, first_value)
|
|
381
|
+
elif isinstance(second_value, LessThan):
|
|
382
|
+
return union_with_less_than(second_value, first_value)
|
|
383
|
+
else:
|
|
384
|
+
raise _OPERATION_WITH_WRONG_TYPE(first_value, second_value)
|
|
385
|
+
else:
|
|
386
|
+
raise _OPERATION_WITH_WRONG_TYPE(first_value, second_value)
|
|
387
|
+
|
|
388
|
+
if other is None:
|
|
389
|
+
return self
|
|
390
|
+
elif isinstance(self, Constant):
|
|
391
|
+
return union_with_constant(self, other)
|
|
392
|
+
elif isinstance(self, Outside):
|
|
393
|
+
return union_with_outside(self, other)
|
|
394
|
+
elif isinstance(self, Between):
|
|
395
|
+
return union_with_between(self, other)
|
|
396
|
+
elif isinstance(self, LessThan):
|
|
397
|
+
return union_with_less_than(self, other)
|
|
398
|
+
elif isinstance(self, GreaterThan):
|
|
399
|
+
return union_with_greater_than(self, other)
|
|
400
|
+
else:
|
|
401
|
+
raise _OPERATION_WITH_WRONG_TYPE(self, other)
|
|
252
402
|
|
|
253
403
|
def print(self) -> str:
|
|
254
404
|
pass
|
|
@@ -98,14 +98,15 @@ class PEDRO(SKEOptimizer, IterativeOptimizer):
|
|
|
98
98
|
return False
|
|
99
99
|
|
|
100
100
|
def search(self):
|
|
101
|
+
max_partitions = 200
|
|
101
102
|
base_partitions = FixedStrategy(2).partition_number(self.dataframe.columns[:-1]) * 3
|
|
102
|
-
if base_partitions <=
|
|
103
|
+
if base_partitions <= max_partitions:
|
|
103
104
|
strategies = [FixedStrategy(2)]
|
|
104
|
-
if FixedStrategy(3).partition_number(self.dataframe.columns[:-1]) <=
|
|
105
|
+
if FixedStrategy(3).partition_number(self.dataframe.columns[:-1]) <= max_partitions:
|
|
105
106
|
strategies.append(FixedStrategy(3))
|
|
106
107
|
else:
|
|
107
108
|
strategies = []
|
|
108
|
-
base_partitions =
|
|
109
|
+
base_partitions = max_partitions
|
|
109
110
|
|
|
110
111
|
for n in [2, 3, 5, 10]:
|
|
111
112
|
for th in [0.99, 0.75, 0.67, 0.5, 0.3]:
|
psyke-0.8.6.dev2/VERSION
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.8.6.dev2
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|