upgini 1.1.296a3521.dev4__py3-none-any.whl → 1.1.296a3521.dev5__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.

Potentially problematic release.


This version of upgini might be problematic. Click here for more details.

upgini/__about__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "1.1.296a3521.dev4"
1
+ __version__ = "1.1.296a3521.dev5"
upgini/autofe/feature.py CHANGED
@@ -16,6 +16,9 @@ class Column:
16
16
  self.data = data
17
17
  self.calculate_all = calculate_all
18
18
 
19
+ def get_name_component(self, **kwargs) -> str:
20
+ return self.name
21
+
19
22
  def get_display_name(self, cache: bool = True, shorten: bool = False, **kwargs) -> str:
20
23
  return self.name
21
24
 
@@ -41,7 +44,7 @@ class Column:
41
44
  def get_column_nodes(self) -> List["Column"]:
42
45
  return [self]
43
46
 
44
- def get_columns(self) -> List[str]:
47
+ def get_columns(self, **kwargs) -> List[str]:
45
48
  return [self.name]
46
49
 
47
50
  def infer_type(self, data: pd.DataFrame) -> DtypeObj:
@@ -57,6 +60,12 @@ class Column:
57
60
  def to_pretty_formula(self) -> str:
58
61
  return self.to_formula()
59
62
 
63
+ def __eq__(self, value: object) -> bool:
64
+ if not isinstance(value, Column):
65
+ return False
66
+ else:
67
+ return self.name == value.name and self.calculate_all == value.calculate_all
68
+
60
69
 
61
70
  class Feature:
62
71
  def __init__(
@@ -125,6 +134,12 @@ class Feature:
125
134
  for child in self.children:
126
135
  child.delete_data()
127
136
 
137
+ def get_name_component(self, **kwargs) -> str:
138
+ return "_".join(ch.get_name_component(**kwargs) for ch in self.children) + "_" + self.get_op_display_name()
139
+
140
+ def get_op_display_name(self) -> str:
141
+ return self.op.alias or self.op.name.lower()
142
+
128
143
  def get_display_name(self, cache: bool = True, shorten: bool = False, **kwargs) -> str:
129
144
  if self.cached_display_name is not None and cache:
130
145
  return self.cached_display_name
@@ -132,11 +147,12 @@ class Feature:
132
147
  if self.alias:
133
148
  components = ["f_autofe", self.alias]
134
149
  elif shorten and not self.op.is_unary:
135
- components = ["f_autofe", self.op.alias or self.op.name.lower()]
150
+ components = ["f_autofe", self.get_op_display_name()]
136
151
  else:
137
- components = ["f_" + "_f_".join(self.get_columns(**kwargs))] + [
152
+ child_components = [ch.get_name_component(**kwargs) for ch in self.children]
153
+ components = ["f_" + "_f_".join(child_components)] + [
138
154
  "autofe",
139
- self.op.alias or self.op.name.lower(),
155
+ self.get_op_display_name(),
140
156
  ]
141
157
  components.extend([str(self.display_index)] if self.display_index is not None else [])
142
158
  display_name = "_".join(components)
@@ -306,8 +322,20 @@ class FeatureGroup:
306
322
  main_column = None if self.main_column_node is None else self.main_column_node.get_columns()[0]
307
323
  if isinstance(self.op, PandasOperand):
308
324
  columns = self.get_columns()
309
- new_data = self.op.calculate_group(data[columns], main_column=main_column)
310
- new_data.rename(columns=dict(zip(columns, self.get_display_names())), inplace=True)
325
+ lower_order_children = [
326
+ ch for f in self.children for ch in f.children if ch.get_display_name() != main_column
327
+ ]
328
+ if any(isinstance(f, Feature) for f in lower_order_children):
329
+ child_data = pd.concat(
330
+ [data[main_column]] + [ch.calculate(data) for ch in lower_order_children], axis=1
331
+ )
332
+ else:
333
+ child_data = data[columns]
334
+
335
+ new_data = self.op.calculate_group(child_data, main_column=main_column)
336
+ new_data.rename(
337
+ columns=dict(zip((c for c in columns if c != main_column), self.get_display_names())), inplace=True
338
+ )
311
339
  else:
312
340
  raise NotImplementedError(f"Unrecognized operator {self.op.name}.")
313
341
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: upgini
3
- Version: 1.1.296a3521.dev4
3
+ Version: 1.1.296a3521.dev5
4
4
  Summary: Intelligent data search & enrichment for Machine Learning
5
5
  Project-URL: Bug Reports, https://github.com/upgini/upgini/issues
6
6
  Project-URL: Homepage, https://upgini.com/
@@ -1,4 +1,4 @@
1
- upgini/__about__.py,sha256=VGHsR03QeKC0Gtu5pTlpKTuNsj9FK3EAS6Xjs7vhoYs,34
1
+ upgini/__about__.py,sha256=hw_DSyyM8S283cgz_zkPjXawAFKkZq2W9BY3bjwwNhE,34
2
2
  upgini/__init__.py,sha256=ObEtjFkIssl83qeKNMLpIQygfwK8TzztwiI43YTsAP0,353
3
3
  upgini/ads.py,sha256=nvuRxRx5MHDMgPr9SiU-fsqRdFaBv8p4_v1oqiysKpc,2714
4
4
  upgini/dataset.py,sha256=7TLVVhGtjgx_9yaiaIUK3kZSe_R9wg5dY0d4F5qCGM4,45636
@@ -17,7 +17,7 @@ upgini/autofe/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  upgini/autofe/all_operands.py,sha256=WJOiNVNVyrWc3vYGMvJtrpGRrLEQ237YMTsWnkUbLNw,2502
18
18
  upgini/autofe/binary.py,sha256=8FXPJxN7fnC5wphO0Dp1tQCa0lFMSDGQGvBMkSIVAcE,4155
19
19
  upgini/autofe/date.py,sha256=va28wBqELETjn1CqZ7bHvz5CcJg8sijFyo9Ti7P-HLw,7711
20
- upgini/autofe/feature.py,sha256=_V9B74B3ue7eAYXSOt9JKhVC9klkAKks22MwnBRye_w,12487
20
+ upgini/autofe/feature.py,sha256=TbPW81696BMbxwxyk14Jv_98kKqDbSKbVK62pjkfI1A,13621
21
21
  upgini/autofe/groupby.py,sha256=4WjDzQxqpZxB79Ih4ihMMI5GDxaFqiH6ZelfV82ClT4,3091
22
22
  upgini/autofe/operand.py,sha256=MKEsl3zxpWzRDpTkE0sNJxTu62U20sWOvEKhPjUWS6s,2915
23
23
  upgini/autofe/unary.py,sha256=ZWjLd-CUkNt_PpM8YuWLLipW1v_RdBlsl4JxXIVo9aM,3652
@@ -57,7 +57,7 @@ upgini/utils/sklearn_ext.py,sha256=13jQS_k7v0aUtudXV6nGUEWjttPQzAW9AFYL5wgEz9k,4
57
57
  upgini/utils/target_utils.py,sha256=Y96_PJ5cC-WsEbeqg20v9uqywDQobLoTb-xoP7S3o4E,7807
58
58
  upgini/utils/track_info.py,sha256=G5Lu1xxakg2_TQjKZk4b5SvrHsATTXNVV3NbvWtT8k8,5663
59
59
  upgini/utils/warning_counter.py,sha256=dIWBB4dI5XRRJZudvIlqlIYKEiwLLPcXarsZuYRt338,227
60
- upgini-1.1.296a3521.dev4.dist-info/METADATA,sha256=wb-EbeLcSYxsUnpMDxht1FCJJBeE87CTuwo3RoF-02A,48127
61
- upgini-1.1.296a3521.dev4.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
62
- upgini-1.1.296a3521.dev4.dist-info/licenses/LICENSE,sha256=5RRzgvdJUu3BUDfv4bzVU6FqKgwHlIay63pPCSmSgzw,1514
63
- upgini-1.1.296a3521.dev4.dist-info/RECORD,,
60
+ upgini-1.1.296a3521.dev5.dist-info/METADATA,sha256=mqBWJm9KU8FLVsvBVixKGPCT7DTBLnxuF4qqD6t8kDo,48127
61
+ upgini-1.1.296a3521.dev5.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
62
+ upgini-1.1.296a3521.dev5.dist-info/licenses/LICENSE,sha256=5RRzgvdJUu3BUDfv4bzVU6FqKgwHlIay63pPCSmSgzw,1514
63
+ upgini-1.1.296a3521.dev5.dist-info/RECORD,,