upgini 1.2.40__py3-none-any.whl → 1.2.41a3758.dev1__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.40"
1
+ __version__ = "1.2.41a3758.dev1"
@@ -165,10 +165,6 @@ class FeaturesEnricher(TransformerMixin):
165
165
 
166
166
  shared_datasets: list of str, optional (default=None)
167
167
  List of private shared dataset ids for custom search
168
-
169
- select_features: bool, optional (default=False)
170
- If True, return only selected features both from input and data sources.
171
- Otherwise, return all features from input and only selected features from data sources.
172
168
  """
173
169
 
174
170
  TARGET_NAME = "target"
@@ -235,7 +231,6 @@ class FeaturesEnricher(TransformerMixin):
235
231
  client_visitorid: Optional[str] = None,
236
232
  custom_bundle_config: Optional[str] = None,
237
233
  add_date_if_missing: bool = True,
238
- select_features: bool = False,
239
234
  disable_force_downsampling: bool = False,
240
235
  id_columns: Optional[List[str]] = None,
241
236
  **kwargs,
@@ -297,7 +292,6 @@ class FeaturesEnricher(TransformerMixin):
297
292
  self.dropped_client_feature_names_ = []
298
293
  self.feature_importances_ = []
299
294
  self.search_id = search_id
300
- self.select_features = select_features
301
295
  self.disable_force_downsampling = disable_force_downsampling
302
296
 
303
297
  if search_id:
@@ -405,6 +399,7 @@ class FeaturesEnricher(TransformerMixin):
405
399
  remove_outliers_calc_metrics: Optional[bool] = None,
406
400
  progress_callback: Optional[Callable[[SearchProgress], Any]] = None,
407
401
  search_id_callback: Optional[Callable[[str], Any]] = None,
402
+ select_features: bool = False,
408
403
  **kwargs,
409
404
  ):
410
405
  """Fit to data.
@@ -440,6 +435,10 @@ class FeaturesEnricher(TransformerMixin):
440
435
 
441
436
  remove_outliers_calc_metrics, optional (default=True)
442
437
  If True then rows with target ouliers will be dropped on metrics calculation
438
+
439
+ select_features: bool, optional (default=False)
440
+ If True, return only selected features both from input and data sources.
441
+ Otherwise, return all features from input and only selected features from data sources.
443
442
  """
444
443
  trace_id = str(uuid.uuid4())
445
444
  start_time = time.time()
@@ -474,6 +473,7 @@ class FeaturesEnricher(TransformerMixin):
474
473
  self.y = y
475
474
  self.eval_set = self._check_eval_set(eval_set, X, self.bundle)
476
475
  self.dump_input(trace_id, X, y, self.eval_set)
476
+ self.__set_select_features(select_features)
477
477
  self.__inner_fit(
478
478
  trace_id,
479
479
  X,
@@ -523,6 +523,10 @@ class FeaturesEnricher(TransformerMixin):
523
523
  finally:
524
524
  self.logger.info(f"Fit elapsed time: {time.time() - start_time}")
525
525
 
526
+ def __set_select_features(self, select_features: bool):
527
+ self.fit_select_features = select_features
528
+ self.runtime_parameters.properties["select_features"] = select_features
529
+
526
530
  def fit_transform(
527
531
  self,
528
532
  X: Union[pd.DataFrame, pd.Series, np.ndarray],
@@ -538,6 +542,7 @@ class FeaturesEnricher(TransformerMixin):
538
542
  estimator: Optional[Any] = None,
539
543
  remove_outliers_calc_metrics: Optional[bool] = None,
540
544
  progress_callback: Optional[Callable[[SearchProgress], Any]] = None,
545
+ select_features: bool = False,
541
546
  **kwargs,
542
547
  ) -> pd.DataFrame:
543
548
  """Fit to data, then transform it.
@@ -578,6 +583,10 @@ class FeaturesEnricher(TransformerMixin):
578
583
  remove_outliers_calc_metrics, optional (default=True)
579
584
  If True then rows with target ouliers will be dropped on metrics calculation
580
585
 
586
+ select_features: bool, optional (default=False)
587
+ If True, return only selected features both from input and data sources.
588
+ Otherwise, return all features from input and only selected features from data sources.
589
+
581
590
  Returns
582
591
  -------
583
592
  X_new: pandas.DataFrame of shape (n_samples, n_features_new)
@@ -612,6 +621,7 @@ class FeaturesEnricher(TransformerMixin):
612
621
  self.X = X
613
622
  self.y = y
614
623
  self.eval_set = self._check_eval_set(eval_set, X, self.bundle)
624
+ self.__set_select_features(select_features)
615
625
  self.dump_input(trace_id, X, y, self.eval_set)
616
626
 
617
627
  if _num_samples(drop_duplicates(X)) > Dataset.MAX_ROWS:
@@ -1231,8 +1241,11 @@ class FeaturesEnricher(TransformerMixin):
1231
1241
  self.logger.info(f"Calculating metrics elapsed time: {time.time() - start_time}")
1232
1242
 
1233
1243
  def _update_shap_values(self, trace_id: str, x_columns: List[str], new_shaps: Dict[str, float]):
1244
+ renaming = self.fit_columns_renaming or {}
1234
1245
  new_shaps = {
1235
- feature: _round_shap_value(shap) for feature, shap in new_shaps.items() if feature in self.feature_names_
1246
+ renaming.get(feature, feature): _round_shap_value(shap)
1247
+ for feature, shap in new_shaps.items()
1248
+ if feature in self.feature_names_ or renaming.get(feature, feature) in self.feature_names_
1236
1249
  }
1237
1250
  self.__prepare_feature_importances(trace_id, x_columns, new_shaps, silent=True)
1238
1251
 
@@ -1461,7 +1474,7 @@ class FeaturesEnricher(TransformerMixin):
1461
1474
  c
1462
1475
  for c in X_sampled.columns.to_list()
1463
1476
  if (
1464
- not self.select_features
1477
+ not self.fit_select_features
1465
1478
  or c in self.feature_names_
1466
1479
  or (self.fit_columns_renaming is not None and self.fit_columns_renaming.get(c) in self.feature_names_)
1467
1480
  )
@@ -3287,8 +3300,8 @@ class FeaturesEnricher(TransformerMixin):
3287
3300
  f"Client ip: {self.client_ip}\n"
3288
3301
  f"Client visitorId: {self.client_visitorid}\n"
3289
3302
  f"Add date if missing: {self.add_date_if_missing}\n"
3290
- f"Select features: {self.select_features}\n"
3291
3303
  f"Disable force downsampling: {self.disable_force_downsampling}\n"
3304
+ f"Id columns: {self.id_columns}\n"
3292
3305
  )
3293
3306
 
3294
3307
  def sample(df):
@@ -3675,7 +3688,7 @@ class FeaturesEnricher(TransformerMixin):
3675
3688
  is_client_feature = feature_meta.name in x_columns
3676
3689
 
3677
3690
  if feature_meta.shap_value == 0.0:
3678
- if self.select_features:
3691
+ if self.fit_select_features:
3679
3692
  self.dropped_client_feature_names_.append(feature_meta.name)
3680
3693
  continue
3681
3694
 
@@ -3684,7 +3697,7 @@ class FeaturesEnricher(TransformerMixin):
3684
3697
  feature_meta.name in self.fit_generated_features
3685
3698
  or feature_meta.name == COUNTRY
3686
3699
  # In select_features mode we select also from etalon features and need to show them
3687
- or (not self.select_features and is_client_feature)
3700
+ or (not self.fit_select_features and is_client_feature)
3688
3701
  ):
3689
3702
  continue
3690
3703
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: upgini
3
- Version: 1.2.40
3
+ Version: 1.2.41a3758.dev1
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,9 +1,9 @@
1
- upgini/__about__.py,sha256=iSJlF17_nAoTrcNmK9Ggvp4uHaLT4lGvRjnsq0x_83c,23
1
+ upgini/__about__.py,sha256=KQ5_UqUf1j9QhJsdY2vLVTEcHPCYbzp5HHMntbtpDpE,33
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=d9VlOs9hTf6eL8TX_9bO400HQj3y_jVGthABvQJqONs,33350
5
5
  upgini/errors.py,sha256=2b_Wbo0OYhLUbrZqdLIx5jBnAsiD1Mcenh-VjR4HCTw,950
6
- upgini/features_enricher.py,sha256=e1psLi5mv6Ml8CG6x_R8SN8hnyfDH0VsZjhFnoswoEY,197918
6
+ upgini/features_enricher.py,sha256=c-NKv3UfMGqcyHb4KZjuCzLj6hW19_1ysi0IWDXYstI,198633
7
7
  upgini/http.py,sha256=plZGTGoi1h2edd8Cnjt4eYB8t4NbBGnZz7DtPTByiNc,42885
8
8
  upgini/lazy_import.py,sha256=74gQ8JuA48BGRLxAo7lNHNKY2D2emMxrUxKGdxVGhuY,1012
9
9
  upgini/metadata.py,sha256=-ibqiNjD7dTagqg53FoEJNEqvAYbwgfyn9PGTRQ_YKU,12054
@@ -59,7 +59,7 @@ upgini/utils/sklearn_ext.py,sha256=13jQS_k7v0aUtudXV6nGUEWjttPQzAW9AFYL5wgEz9k,4
59
59
  upgini/utils/target_utils.py,sha256=RlpKGss9kMibVSlA8iZuO_qxmyeplqzn7X8g6hiGGGs,14341
60
60
  upgini/utils/track_info.py,sha256=G5Lu1xxakg2_TQjKZk4b5SvrHsATTXNVV3NbvWtT8k8,5663
61
61
  upgini/utils/warning_counter.py,sha256=-GRY8EUggEBKODPSuXAkHn9KnEQwAORC0mmz_tim-PM,254
62
- upgini-1.2.40.dist-info/METADATA,sha256=_UmnR2uPQq6LIgUN2-Z9B_QzrgC3sn8GflT4upbc4fg,49054
63
- upgini-1.2.40.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
64
- upgini-1.2.40.dist-info/licenses/LICENSE,sha256=5RRzgvdJUu3BUDfv4bzVU6FqKgwHlIay63pPCSmSgzw,1514
65
- upgini-1.2.40.dist-info/RECORD,,
62
+ upgini-1.2.41a3758.dev1.dist-info/METADATA,sha256=gfveQriK3BlEZTWtxNrMlApMona-ghB5CzCN0HRVGMs,49064
63
+ upgini-1.2.41a3758.dev1.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
64
+ upgini-1.2.41a3758.dev1.dist-info/licenses/LICENSE,sha256=5RRzgvdJUu3BUDfv4bzVU6FqKgwHlIay63pPCSmSgzw,1514
65
+ upgini-1.2.41a3758.dev1.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.25.0
2
+ Generator: hatchling 1.24.2
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any