psyke 0.7.3.dev9__tar.gz → 0.7.5.dev1__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.7.3.dev9/psyke.egg-info → psyke-0.7.5.dev1}/PKG-INFO +1 -1
- psyke-0.7.5.dev1/VERSION +1 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/extraction/hypercubic/gridex/__init__.py +5 -4
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/extraction/hypercubic/hex/__init__.py +6 -2
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/extraction/hypercubic/hypercube.py +11 -9
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/extraction/hypercubic/iter/__init__.py +2 -1
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1/psyke.egg-info}/PKG-INFO +1 -1
- psyke-0.7.3.dev9/VERSION +0 -1
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/LICENSE +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/MANIFEST.in +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/README.md +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/clustering/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/clustering/cream/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/clustering/exact/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/clustering/utils.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/extraction/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/extraction/cart/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/extraction/cart/predictor.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/extraction/hypercubic/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/extraction/hypercubic/cosmik/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/extraction/hypercubic/creepy/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/extraction/hypercubic/divine/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/extraction/hypercubic/gridrex/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/extraction/hypercubic/strategy.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/extraction/hypercubic/utils.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/extraction/real/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/extraction/real/utils.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/extraction/trepan/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/extraction/trepan/utils.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/hypercubepredictor.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/schema/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/tuning/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/tuning/crash/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/tuning/orchid/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/tuning/pedro/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/utils/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/utils/dataframe.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/utils/logic.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/utils/metrics.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/utils/plot.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke/utils/sorted.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke.egg-info/SOURCES.txt +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke.egg-info/dependency_links.txt +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke.egg-info/not-zip-safe +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke.egg-info/requires.txt +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/psyke.egg-info/top_level.txt +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/pyproject.toml +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/setup.cfg +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/setup.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/test/psyke/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/test/psyke/clustering/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/test/psyke/extraction/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/test/psyke/extraction/cart/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/test/psyke/extraction/cart/test_cart.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/test/psyke/extraction/cart/test_simplified_cart.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/test/psyke/extraction/hypercubic/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/test/psyke/extraction/hypercubic/gridex/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/test/psyke/extraction/hypercubic/gridex/test_gridex.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/test/psyke/extraction/hypercubic/iter/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/test/psyke/extraction/hypercubic/iter/test_iter.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/test/psyke/extraction/hypercubic/test_hypercube.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/test/psyke/extraction/real/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/test/psyke/extraction/real/test_real.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/test/psyke/extraction/real/test_rule.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/test/psyke/extraction/trepan/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/test/psyke/extraction/trepan/test_node.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/test/psyke/extraction/trepan/test_split.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/test/psyke/extraction/trepan/test_trepan.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/test/psyke/utils/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/test/psyke/utils/test_prune.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/test/psyke/utils/test_simplify.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/test/psyke/utils/test_simplify_formatter.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/test/resources/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/test/resources/datasets/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/test/resources/predictors/__init__.py +0 -0
- {psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/test/resources/tests/__init__.py +0 -0
psyke-0.7.5.dev1/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.7.5.dev1
|
|
@@ -43,7 +43,7 @@ class GridEx(HyperCubeExtractor):
|
|
|
43
43
|
ranges[feature] = [(a + size * i, a + size * (i + 1)) for i in range(n_bins)]
|
|
44
44
|
return ranges
|
|
45
45
|
|
|
46
|
-
def _cubes_to_split(self, cube, iteration, dataframe, fake, keep_empty=False):
|
|
46
|
+
def _cubes_to_split(self, cube, surrounding, iteration, dataframe, fake, keep_empty=False):
|
|
47
47
|
to_split = []
|
|
48
48
|
for (pn, p) in enumerate(list(product(*self._create_ranges(cube, iteration).values()))):
|
|
49
49
|
cube = self._default_cube()
|
|
@@ -51,10 +51,10 @@ class GridEx(HyperCubeExtractor):
|
|
|
51
51
|
cube.update_dimension(f, p[i])
|
|
52
52
|
n = cube.count(dataframe)
|
|
53
53
|
if n > 0 or keep_empty:
|
|
54
|
-
fake = pd.concat([fake, cube.create_samples(self.min_examples - n, self._generator)])
|
|
54
|
+
fake = pd.concat([fake, cube.create_samples(self.min_examples - n, surrounding, self._generator)])
|
|
55
55
|
cube.update(fake, self.predictor)
|
|
56
56
|
to_split.append(cube)
|
|
57
|
-
return to_split
|
|
57
|
+
return to_split, fake
|
|
58
58
|
|
|
59
59
|
def _iterate(self, surrounding: HyperCube, dataframe: pd.DataFrame):
|
|
60
60
|
fake = dataframe.copy()
|
|
@@ -69,7 +69,8 @@ class GridEx(HyperCubeExtractor):
|
|
|
69
69
|
if cube.diversity < self.threshold:
|
|
70
70
|
self._hypercubes += [cube]
|
|
71
71
|
continue
|
|
72
|
-
|
|
72
|
+
to_split, fake = self._cubes_to_split(cube, surrounding, iteration, dataframe, fake)
|
|
73
|
+
next_iteration += [c for c in self._merge(to_split, fake)]
|
|
73
74
|
prev = next_iteration.copy()
|
|
74
75
|
self._hypercubes += [cube for cube in next_iteration]
|
|
75
76
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import numpy as np
|
|
1
2
|
import pandas as pd
|
|
2
3
|
from sklearn.linear_model import LinearRegression
|
|
3
4
|
|
|
@@ -41,10 +42,13 @@ class HEx(GridEx):
|
|
|
41
42
|
for cube in prev:
|
|
42
43
|
# subcubes =
|
|
43
44
|
# [c for c in self._merge(self._cubes_to_split(cube, iteration, dataframe, fake, True), fake)]
|
|
44
|
-
subcubes =
|
|
45
|
+
subcubes, fake = self._cubes_to_split(cube, surrounding, iteration, dataframe, fake, True)
|
|
45
46
|
cleaned = [c for c in subcubes if c.count(dataframe) > 0 and self._gain(cube, c)]
|
|
46
47
|
if len(subcubes) > len(cleaned):
|
|
48
|
+
if len(cleaned) > 0:
|
|
49
|
+
idx = np.any([c.filter_indices(fake.iloc[:, :-1]) for c in cleaned], axis=0)
|
|
50
|
+
cube.update(fake[~idx], self.predictor)
|
|
47
51
|
self._hypercubes = [cube] + self._hypercubes
|
|
48
|
-
next_iteration += cleaned
|
|
52
|
+
next_iteration += self._merge(cleaned, fake)
|
|
49
53
|
prev = next_iteration.copy()
|
|
50
54
|
self._hypercubes = [cube for cube in next_iteration] + self._hypercubes
|
|
@@ -158,8 +158,9 @@ class HyperCube:
|
|
|
158
158
|
return '*'
|
|
159
159
|
raise Exception('Too many limits for this feature')
|
|
160
160
|
|
|
161
|
-
def create_samples(self, n: int = 1,
|
|
162
|
-
|
|
161
|
+
def create_samples(self, n: int = 1, surrounding: GenericCube = None,
|
|
162
|
+
generator: Random = Random(get_default_random_seed())) -> pd.DataFrame:
|
|
163
|
+
return pd.DataFrame([self._create_tuple(generator, surrounding) for _ in range(n)])
|
|
163
164
|
|
|
164
165
|
@staticmethod
|
|
165
166
|
def check_overlap(to_check: Iterable[HyperCube], hypercubes: Iterable[HyperCube]) -> bool:
|
|
@@ -208,9 +209,10 @@ class HyperCube:
|
|
|
208
209
|
return RegressionCube(dimensions)
|
|
209
210
|
return HyperCube(dimensions)
|
|
210
211
|
|
|
211
|
-
def _create_tuple(self, generator: Random) -> dict:
|
|
212
|
-
|
|
213
|
-
|
|
212
|
+
def _create_tuple(self, generator: Random, surrounding: GenericCube) -> dict:
|
|
213
|
+
minmax = {k: (self[k][0] if np.isfinite(self[k][0]) else surrounding[k][0],
|
|
214
|
+
self[k][1] if np.isfinite(self[k][1]) else surrounding[k][1]) for k in self._dimensions.keys()}
|
|
215
|
+
return {k: generator.uniform(minmax[k][0], minmax[k][1]) for k in self._dimensions.keys()}
|
|
214
216
|
|
|
215
217
|
@staticmethod
|
|
216
218
|
def cube_from_point(point: dict[str, float], output=None) -> GenericCube:
|
|
@@ -243,11 +245,11 @@ class HyperCube:
|
|
|
243
245
|
for update in updates:
|
|
244
246
|
self._expand_one(update, surrounding, ratio)
|
|
245
247
|
|
|
246
|
-
def get_first(self, feature: str
|
|
247
|
-
return self[feature][0]
|
|
248
|
+
def get_first(self, feature: str) -> float:
|
|
249
|
+
return self[feature][0]
|
|
248
250
|
|
|
249
|
-
def get_second(self, feature: str
|
|
250
|
-
return self[feature][1]
|
|
251
|
+
def get_second(self, feature: str) -> float:
|
|
252
|
+
return self[feature][1]
|
|
251
253
|
|
|
252
254
|
def has_volume(self) -> bool:
|
|
253
255
|
return all([dimension[1] - dimension[0] > HyperCube.EPSILON for dimension in self._dimensions.values()])
|
|
@@ -38,7 +38,8 @@ class ITER(HyperCubeExtractor):
|
|
|
38
38
|
expansions = []
|
|
39
39
|
for limit in cubes:
|
|
40
40
|
count = limit.cube.count(dataframe)
|
|
41
|
-
dataframe = pd.concat([dataframe, limit.cube.create_samples(self.min_examples - count,
|
|
41
|
+
dataframe = pd.concat([dataframe, limit.cube.create_samples(self.min_examples - count,
|
|
42
|
+
generator=self.__generator)])
|
|
42
43
|
limit.cube.update(dataframe, self.predictor)
|
|
43
44
|
expansions.append(Expansion(
|
|
44
45
|
limit.cube, limit.feature, limit.direction,
|
psyke-0.7.3.dev9/VERSION
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.7.3.dev9
|
|
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
|
{psyke-0.7.3.dev9 → psyke-0.7.5.dev1}/test/psyke/extraction/hypercubic/gridex/test_gridex.py
RENAMED
|
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
|