upgini 1.2.122a1__py3-none-any.whl → 1.2.122a3__py3-none-any.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.
- upgini/__about__.py +1 -1
- upgini/autofe/feature.py +6 -0
- upgini/autofe/operator.py +26 -0
- {upgini-1.2.122a1.dist-info → upgini-1.2.122a3.dist-info}/METADATA +1 -1
- {upgini-1.2.122a1.dist-info → upgini-1.2.122a3.dist-info}/RECORD +7 -7
- {upgini-1.2.122a1.dist-info → upgini-1.2.122a3.dist-info}/WHEEL +0 -0
- {upgini-1.2.122a1.dist-info → upgini-1.2.122a3.dist-info}/licenses/LICENSE +0 -0
upgini/__about__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "1.2.
|
1
|
+
__version__ = "1.2.122a3"
|
upgini/autofe/feature.py
CHANGED
@@ -150,6 +150,12 @@ class Feature:
|
|
150
150
|
self.cached_display_name = None
|
151
151
|
return self
|
152
152
|
|
153
|
+
def rename_op_params(self, mapping: Dict[str, str]) -> "Feature":
|
154
|
+
self.op.rename_params(mapping)
|
155
|
+
for child in self.children:
|
156
|
+
child.rename_op_params(mapping)
|
157
|
+
return self
|
158
|
+
|
153
159
|
def get_column_nodes(self) -> List[Union[Column, "Feature"]]:
|
154
160
|
res = []
|
155
161
|
for child in self.children:
|
upgini/autofe/operator.py
CHANGED
@@ -89,6 +89,32 @@ class Operator(BaseModel, metaclass=OperatorRegistry):
|
|
89
89
|
def delete_data(self):
|
90
90
|
pass
|
91
91
|
|
92
|
+
def rename_params(self, columns_renaming: Dict[str, str]) -> "Operator":
|
93
|
+
# Rename occurrences of column names inside self.params keys according to columns_renaming
|
94
|
+
if not self.params or not columns_renaming:
|
95
|
+
return self
|
96
|
+
|
97
|
+
# Replace longer keys first to avoid partial overlaps
|
98
|
+
replacements = sorted(columns_renaming.items(), key=lambda kv: -len(kv[0]))
|
99
|
+
|
100
|
+
renamed_params: Dict[str, str] = {}
|
101
|
+
for param_key, param_value in self.params.items():
|
102
|
+
new_key = param_key
|
103
|
+
for old, new in replacements:
|
104
|
+
if old and old in new_key:
|
105
|
+
new_key = new_key.replace(old, new)
|
106
|
+
|
107
|
+
if new_key in renamed_params and new_key != param_key:
|
108
|
+
self._logger.warning(
|
109
|
+
"Param key collision after rename: '%s' -> '%s'. Overwriting value.",
|
110
|
+
param_key,
|
111
|
+
new_key,
|
112
|
+
)
|
113
|
+
renamed_params[new_key] = param_value
|
114
|
+
|
115
|
+
self.params = renamed_params
|
116
|
+
return self
|
117
|
+
|
92
118
|
|
93
119
|
class ParametrizedOperator(Operator, abc.ABC):
|
94
120
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
upgini/__about__.py,sha256=
|
1
|
+
upgini/__about__.py,sha256=UFJbeQHpz2jM4p2wkedP7-19FF_uYQi7NMc3T0Nom0c,26
|
2
2
|
upgini/__init__.py,sha256=LXSfTNU0HnlOkE69VCxkgIKDhWP-JFo_eBQ71OxTr5Y,261
|
3
3
|
upgini/ads.py,sha256=nvuRxRx5MHDMgPr9SiU-fsqRdFaBv8p4_v1oqiysKpc,2714
|
4
4
|
upgini/dataset.py,sha256=pQ8JQe0cdygD-W9GefJmfE6bnj4EYzXsjlgWdIS9nS8,31578
|
@@ -16,9 +16,9 @@ upgini/autofe/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
16
|
upgini/autofe/all_operators.py,sha256=rdjF5eaE4bC6Q4eu_el5Z7ekYt8DjOFermz2bePPbUc,333
|
17
17
|
upgini/autofe/binary.py,sha256=oOEECc4nRzZN2tYaiqx8F2XHnfWpk1bVvb7ZkZJ0lO8,7709
|
18
18
|
upgini/autofe/date.py,sha256=RvexgrL1_6ISYPVrl9HUQmPgpVSGQsTNv8YhNQWs-5M,11329
|
19
|
-
upgini/autofe/feature.py,sha256=
|
19
|
+
upgini/autofe/feature.py,sha256=6Zfni6s4K8aHNnjaoA1kDBYNvdKPejBIBsmXlCfZr-w,16832
|
20
20
|
upgini/autofe/groupby.py,sha256=IYmQV9uoCdRcpkeWZj_kI3ObzoNCNx3ff3h8sTL01tk,3603
|
21
|
-
upgini/autofe/operator.py,sha256=
|
21
|
+
upgini/autofe/operator.py,sha256=3i4aWqlRomgTIVAPnivwFb3St87UoWMtZBTzQNJCyuU,6278
|
22
22
|
upgini/autofe/unary.py,sha256=FFtvkQaT0cu_zPZ1jCLcsjik-UUh12qQFF3tUW8NqsE,6675
|
23
23
|
upgini/autofe/utils.py,sha256=dYrtyAM8Vcc_R8u4dNo54IsGrHKagTHDJTKhGho0bRg,2967
|
24
24
|
upgini/autofe/vector.py,sha256=r5H6DKT5f3KNjERpV2OOloZ96nDWkModXnpsqw_A77Q,2313
|
@@ -74,7 +74,7 @@ upgini/utils/target_utils.py,sha256=GCPn4QeJ83JJ_vyBJ3IhY5fyIRkLC9q9BE59S2FRO1I,
|
|
74
74
|
upgini/utils/track_info.py,sha256=G5Lu1xxakg2_TQjKZk4b5SvrHsATTXNVV3NbvWtT8k8,5663
|
75
75
|
upgini/utils/ts_utils.py,sha256=26vhC0pN7vLXK6R09EEkMK3Lwb9IVPH7LRdqFIQ3kPs,1383
|
76
76
|
upgini/utils/warning_counter.py,sha256=-GRY8EUggEBKODPSuXAkHn9KnEQwAORC0mmz_tim-PM,254
|
77
|
-
upgini-1.2.
|
78
|
-
upgini-1.2.
|
79
|
-
upgini-1.2.
|
80
|
-
upgini-1.2.
|
77
|
+
upgini-1.2.122a3.dist-info/METADATA,sha256=FaNNku5DRx67X-uTBYfRduZMzUAS6Njio-cI7xMM190,50745
|
78
|
+
upgini-1.2.122a3.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
79
|
+
upgini-1.2.122a3.dist-info/licenses/LICENSE,sha256=5RRzgvdJUu3BUDfv4bzVU6FqKgwHlIay63pPCSmSgzw,1514
|
80
|
+
upgini-1.2.122a3.dist-info/RECORD,,
|
File without changes
|
File without changes
|