upgini 1.2.13__py3-none-any.whl → 1.2.13a2__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.2.13"
1
+ __version__ = "1.2.13a2"
upgini/autofe/binary.py CHANGED
@@ -132,7 +132,7 @@ class CombineThenFreq(PandasOperand):
132
132
  self._loc(temp, value_counts)
133
133
 
134
134
 
135
- class Distance(PandasOperand):
135
+ class Distance:
136
136
  name: str = "dist"
137
137
  is_binary: bool = True
138
138
  output_type: Optional[str] = "float"
@@ -140,21 +140,27 @@ class Distance(PandasOperand):
140
140
  has_symmetry_importance: bool = True
141
141
 
142
142
  def calculate_binary(self, left: pd.Series, right: pd.Series) -> pd.Series:
143
+ # Handle None values by replacing them with 0 in the dot product and norm calculations
144
+ left = left.apply(lambda x: np.array(x) if x is not None else np.zeros_like(right[0]))
145
+ right = right.apply(lambda x: np.array(x) if x is not None else np.zeros_like(left[0]))
146
+
143
147
  return pd.Series(
144
148
  1 - self.__dot(left, right) / (self.__norm(left) * self.__norm(right)), index=left.index
145
- ).astype(np.float64)
149
+ )
146
150
 
147
151
  # row-wise dot product, handling None values
148
152
  def __dot(self, left: pd.Series, right: pd.Series) -> pd.Series:
149
- left = left.apply(lambda x: np.array(x))
150
- right = right.apply(lambda x: np.array(x))
151
- res = (left.dropna() * right.dropna()).apply(np.sum)
152
- res = res.reindex(left.index.union(right.index))
153
+ left = left.apply(lambda x: np.array(x) if x is not None else np.zeros_like(right[0]))
154
+ right = right.apply(lambda x: np.array(x) if x is not None else np.zeros_like(left[0]))
155
+
156
+ # Perform element-wise multiplication and handle missing values
157
+ res = (left * right).apply(np.sum)
153
158
  return res
154
159
 
155
160
  # Calculate the norm of a vector, handling None values
156
161
  def __norm(self, vector: pd.Series) -> pd.Series:
157
- vector = vector.fillna(np.nan)
162
+ # Replace None with a zero vector
163
+ vector = vector.apply(lambda x: np.array(x) if x is not None else np.zeros_like(vector[0]))
158
164
  return np.sqrt(self.__dot(vector, vector))
159
165
 
160
166
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: upgini
3
- Version: 1.2.13
3
+ Version: 1.2.13a2
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=rQSlPcfj4yT4krIq6epTVQyBzIX4etVOgfupVkM-RnU,23
1
+ upgini/__about__.py,sha256=hwBCVZvUNp4Oos-G-FVBndpBVHIsC2I6VH0LltckZ0Y,25
2
2
  upgini/__init__.py,sha256=M64LwQTBa-5Jz24Zm2h8rWwlKQQ1J8nP7gGgIciS0WU,589
3
3
  upgini/ads.py,sha256=nvuRxRx5MHDMgPr9SiU-fsqRdFaBv8p4_v1oqiysKpc,2714
4
4
  upgini/dataset.py,sha256=olZ-OHSfBNoBSCo7R5t7uCLukI2nO7afpx_A-HCiJLk,31067
@@ -15,7 +15,7 @@ upgini/ads_management/__init__.py,sha256=qzyisOToVRP-tquAJD1PblZhNtMrOB8FiyF9Jvf
15
15
  upgini/ads_management/ads_manager.py,sha256=igVbN2jz80Umb2BUJixmJVj-zx8unoKpecVo-R-nGdw,2648
16
16
  upgini/autofe/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  upgini/autofe/all_operands.py,sha256=cCCB44qvkmuWyiRM5Xykx8tkHPIjQthrWyj67STWN80,2578
18
- upgini/autofe/binary.py,sha256=zMhtHVuGUAFLUqem-XiXqJj-GRXxS88tdz8tFuDfSNM,7659
18
+ upgini/autofe/binary.py,sha256=bszs7s7IqymOgaNAcR-4MIIV_DHUka4YZkTX7bsuFr8,8104
19
19
  upgini/autofe/date.py,sha256=OpFc3Al0xO3qlESn2Uokfxw51ArVqmh3xngWwdrsaqE,9762
20
20
  upgini/autofe/feature.py,sha256=eL7wABUhDKZzv3E-RPJNcyGwSfB0UptcfU2RbvsOks4,15082
21
21
  upgini/autofe/groupby.py,sha256=r-xl_keZZgm_tpiEoDhjYSkT6NHv7a4cRQR4wJ4uCp8,3263
@@ -57,7 +57,7 @@ upgini/utils/sklearn_ext.py,sha256=13jQS_k7v0aUtudXV6nGUEWjttPQzAW9AFYL5wgEz9k,4
57
57
  upgini/utils/target_utils.py,sha256=BVtDmrmFMKerSUWaNOIEdzsYHIFiODdpnWbE50QDPDc,7864
58
58
  upgini/utils/track_info.py,sha256=G5Lu1xxakg2_TQjKZk4b5SvrHsATTXNVV3NbvWtT8k8,5663
59
59
  upgini/utils/warning_counter.py,sha256=dIWBB4dI5XRRJZudvIlqlIYKEiwLLPcXarsZuYRt338,227
60
- upgini-1.2.13.dist-info/METADATA,sha256=IRJWMi0M4nUgCqMwp4kffx8QXgR1DJ2VsqH5Y7-nQ2E,48577
61
- upgini-1.2.13.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
62
- upgini-1.2.13.dist-info/licenses/LICENSE,sha256=5RRzgvdJUu3BUDfv4bzVU6FqKgwHlIay63pPCSmSgzw,1514
63
- upgini-1.2.13.dist-info/RECORD,,
60
+ upgini-1.2.13a2.dist-info/METADATA,sha256=tZl3cZEAUiIpzU1tZ5TPM3Q9hRCR54whSZp3z95rXss,48579
61
+ upgini-1.2.13a2.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
62
+ upgini-1.2.13a2.dist-info/licenses/LICENSE,sha256=5RRzgvdJUu3BUDfv4bzVU6FqKgwHlIay63pPCSmSgzw,1514
63
+ upgini-1.2.13a2.dist-info/RECORD,,