upgini 1.2.0a1__py3-none-any.whl → 1.2.1__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.0a1"
1
+ __version__ = "1.2.1"
upgini/autofe/unary.py CHANGED
@@ -1,7 +1,6 @@
1
- from typing import Optional
1
+ from typing import Dict, Optional
2
2
  import numpy as np
3
3
  import pandas as pd
4
- from sklearn.preprocessing import Normalizer
5
4
 
6
5
  from upgini.autofe.operand import PandasOperand, VectorizableMixin
7
6
 
@@ -119,17 +118,32 @@ class Norm(PandasOperand):
119
118
  name: str = "norm"
120
119
  is_unary: bool = True
121
120
  output_type: Optional[str] = "float"
121
+ norm: Optional[float] = None
122
122
 
123
123
  def calculate_unary(self, data: pd.Series) -> pd.Series:
124
124
  data_dropna = data.dropna()
125
125
  if data_dropna.empty:
126
126
  return data
127
127
 
128
- normalized_data = Normalizer().transform(data_dropna.to_frame().T).T
129
- normalized_data = pd.Series(normalized_data[:, 0], index=data_dropna.index, name=data.name)
130
- normalized_data = normalized_data.reindex(data.index)
128
+ if self.norm is not None:
129
+ normalized_data = data / self.norm
130
+ else:
131
+ self.norm = np.sqrt(np.sum(data * data))
132
+ normalized_data = data / self.norm
133
+
131
134
  return normalized_data
132
135
 
136
+ def set_params(self, params: Dict[str, str]):
137
+ super().set_params(params)
138
+ if "norm" in params:
139
+ self.norm = params["norm"]
140
+ return self
141
+
142
+ def get_params(self) -> Dict[str, Optional[str]]:
143
+ res = super().get_params()
144
+ res["norm"] = self.norm
145
+ return res
146
+
133
147
 
134
148
  class Embeddings(PandasOperand):
135
149
  name: str = "emb"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: upgini
3
- Version: 1.2.0a1
3
+ Version: 1.2.1
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=dMk28IuEJr_qWW7xH2uH2BnZ8G_djCORGGd6opmGetw,24
1
+ upgini/__about__.py,sha256=Mlm4Gvmb_6yQxwUbv2Ksc-BJFXLPg9H1Vt2iV7wXrA4,22
2
2
  upgini/__init__.py,sha256=Xs0YFVBu1KUdtZzbStGRPQtLt3YLzJnjx5nIUBlX8BE,415
3
3
  upgini/ads.py,sha256=nvuRxRx5MHDMgPr9SiU-fsqRdFaBv8p4_v1oqiysKpc,2714
4
4
  upgini/dataset.py,sha256=olZ-OHSfBNoBSCo7R5t7uCLukI2nO7afpx_A-HCiJLk,31067
@@ -20,7 +20,7 @@ upgini/autofe/date.py,sha256=OpFc3Al0xO3qlESn2Uokfxw51ArVqmh3xngWwdrsaqE,9762
20
20
  upgini/autofe/feature.py,sha256=gwGWY2UcX_0wHAvfEiu1rRU7GFZyzMWZIaPVcf6kD80,14223
21
21
  upgini/autofe/groupby.py,sha256=r-xl_keZZgm_tpiEoDhjYSkT6NHv7a4cRQR4wJ4uCp8,3263
22
22
  upgini/autofe/operand.py,sha256=uk883RaNqgXqtkaRqA1re1d9OFnnpv0JVvelYx09Yw0,2943
23
- upgini/autofe/unary.py,sha256=RiK-Fz3fgjPlqWWfro6x7qChjEZ8W8RTnl5-MT1kaQA,4218
23
+ upgini/autofe/unary.py,sha256=VTX5BdPJUArt-H9qYfOghKw_WlUatFjZto6zu3KGjb4,4484
24
24
  upgini/autofe/vector.py,sha256=ehcZUDqV71TfbU8EmKfdYp603gS2dJY_-fpr10ho5sI,663
25
25
  upgini/data_source/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
26
  upgini/data_source/data_source_publisher.py,sha256=Vg0biG86YB0OEaoxbK9YYrr4yARm11_h3bTWIBgoScA,22115
@@ -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.0a1.dist-info/METADATA,sha256=568JisotupYzFolx0QDyv_qN5CtSIEuHuium23_SDp8,48230
61
- upgini-1.2.0a1.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
62
- upgini-1.2.0a1.dist-info/licenses/LICENSE,sha256=5RRzgvdJUu3BUDfv4bzVU6FqKgwHlIay63pPCSmSgzw,1514
63
- upgini-1.2.0a1.dist-info/RECORD,,
60
+ upgini-1.2.1.dist-info/METADATA,sha256=6kMBYOGEY3dcShtSVLc1Qo9kyL8dKwdmFXZXhM1vzFA,48228
61
+ upgini-1.2.1.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
62
+ upgini-1.2.1.dist-info/licenses/LICENSE,sha256=5RRzgvdJUu3BUDfv4bzVU6FqKgwHlIay63pPCSmSgzw,1514
63
+ upgini-1.2.1.dist-info/RECORD,,