upgini 1.1.285a3418.post1__tar.gz → 1.1.286__tar.gz

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.
Files changed (64) hide show
  1. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/PKG-INFO +1 -1
  2. upgini-1.1.286/src/upgini/__about__.py +1 -0
  3. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/autofe/date.py +1 -1
  4. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/features_enricher.py +7 -8
  5. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/utils/custom_loss_utils.py +39 -36
  6. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/version_validator.py +1 -1
  7. upgini-1.1.285a3418.post1/src/upgini/__about__.py +0 -1
  8. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/.gitignore +0 -0
  9. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/LICENSE +0 -0
  10. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/README.md +0 -0
  11. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/pyproject.toml +0 -0
  12. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/__init__.py +0 -0
  13. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/ads.py +0 -0
  14. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/ads_management/__init__.py +0 -0
  15. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/ads_management/ads_manager.py +0 -0
  16. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/autofe/__init__.py +0 -0
  17. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/autofe/all_operands.py +0 -0
  18. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/autofe/binary.py +0 -0
  19. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/autofe/feature.py +0 -0
  20. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/autofe/groupby.py +0 -0
  21. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/autofe/operand.py +0 -0
  22. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/autofe/unary.py +0 -0
  23. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/autofe/vector.py +0 -0
  24. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/data_source/__init__.py +0 -0
  25. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/data_source/data_source_publisher.py +0 -0
  26. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/dataset.py +0 -0
  27. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/errors.py +0 -0
  28. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/http.py +0 -0
  29. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/mdc/__init__.py +0 -0
  30. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/mdc/context.py +0 -0
  31. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/metadata.py +0 -0
  32. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/metrics.py +0 -0
  33. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/normalizer/__init__.py +0 -0
  34. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/normalizer/phone_normalizer.py +0 -0
  35. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/resource_bundle/__init__.py +0 -0
  36. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/resource_bundle/exceptions.py +0 -0
  37. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/resource_bundle/strings.properties +0 -0
  38. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/resource_bundle/strings_widget.properties +0 -0
  39. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/sampler/__init__.py +0 -0
  40. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/sampler/base.py +0 -0
  41. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/sampler/random_under_sampler.py +0 -0
  42. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/sampler/utils.py +0 -0
  43. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/search_task.py +0 -0
  44. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/spinner.py +0 -0
  45. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/utils/__init__.py +0 -0
  46. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/utils/base_search_key_detector.py +0 -0
  47. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/utils/blocked_time_series.py +0 -0
  48. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/utils/country_utils.py +0 -0
  49. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/utils/cv_utils.py +0 -0
  50. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/utils/datetime_utils.py +0 -0
  51. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/utils/deduplicate_utils.py +0 -0
  52. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/utils/display_utils.py +0 -0
  53. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/utils/email_utils.py +0 -0
  54. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/utils/fallback_progress_bar.py +0 -0
  55. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/utils/features_validator.py +0 -0
  56. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/utils/format.py +0 -0
  57. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/utils/ip_utils.py +0 -0
  58. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/utils/phone_utils.py +0 -0
  59. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/utils/postal_code_utils.py +0 -0
  60. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/utils/progress_bar.py +0 -0
  61. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/utils/sklearn_ext.py +0 -0
  62. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/utils/target_utils.py +0 -0
  63. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/utils/track_info.py +0 -0
  64. {upgini-1.1.285a3418.post1 → upgini-1.1.286}/src/upgini/utils/warning_counter.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: upgini
3
- Version: 1.1.285a3418.post1
3
+ Version: 1.1.286
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/
@@ -0,0 +1 @@
1
+ __version__ = "1.1.286"
@@ -188,7 +188,7 @@ class DatePercentile(PandasOperand):
188
188
 
189
189
  month_diffs = 12 * (years - (self.zero_year or 0)) + (months - (self.zero_month or 0))
190
190
  bounds = month_diffs.apply(
191
- lambda d: np.array(self.zero_bounds if self.zero_bounds is not None else []) + d * 30
191
+ lambda d: np.array(self.zero_bounds if self.zero_bounds is not None else []) + d * self.step
192
192
  )
193
193
 
194
194
  return right.index.to_series().apply(lambda i: self.__perc(right[i], bounds[i]))
@@ -423,7 +423,7 @@ class FeaturesEnricher(TransformerMixin):
423
423
 
424
424
  self.logger.info("Start fit")
425
425
 
426
- self.__validate_search_keys(self.search_keys, self.search_id)
426
+ self.__validate_search_keys(self.search_keys)
427
427
 
428
428
  # Validate client estimator params
429
429
  self._get_client_cat_features(estimator, X, self.search_keys)
@@ -557,7 +557,7 @@ class FeaturesEnricher(TransformerMixin):
557
557
 
558
558
  self.logger.info("Start fit_transform")
559
559
 
560
- self.__validate_search_keys(self.search_keys, self.search_id)
560
+ self.__validate_search_keys(self.search_keys)
561
561
 
562
562
  search_progress = SearchProgress(0.0, ProgressStage.START_FIT)
563
563
  if progress_callback is not None:
@@ -972,6 +972,8 @@ class FeaturesEnricher(TransformerMixin):
972
972
 
973
973
  # 2 Fit and predict with KFold estimator on enriched tds
974
974
  # and calculate final metric (and uplift)
975
+ enriched_metric = None
976
+ uplift = None
975
977
  enriched_estimator = None
976
978
  if set(fitting_X.columns) != set(fitting_enriched_X.columns):
977
979
  self.logger.info(
@@ -992,18 +994,15 @@ class FeaturesEnricher(TransformerMixin):
992
994
  has_date=has_date,
993
995
  )
994
996
  enriched_metric = enriched_estimator.cross_val_predict(fitting_enriched_X, enriched_y_sorted)
995
- if etalon_metric is None:
997
+ if enriched_metric is None:
996
998
  self.logger.warning(
997
999
  f"Enriched {metric} on train combined features is None (maybe all features was removed)"
998
1000
  )
999
1001
  enriched_estimator = None
1000
- uplift = None
1001
1002
  else:
1002
1003
  self.logger.info(f"Enriched {metric} on train combined features: {enriched_metric}")
1004
+ if etalon_metric is not None and enriched_metric is not None:
1003
1005
  uplift = (enriched_metric - etalon_metric) * multiplier
1004
- else:
1005
- enriched_metric = None
1006
- uplift = None
1007
1006
 
1008
1007
  train_metrics = {
1009
1008
  self.bundle.get("quality_metrics_segment_header"): self.bundle.get(
@@ -2147,7 +2146,7 @@ class FeaturesEnricher(TransformerMixin):
2147
2146
  ]
2148
2147
  return excluded_features[feature_name_header].values.tolist()
2149
2148
 
2150
- def __validate_search_keys(self, search_keys: Dict[str, SearchKey], search_id: Optional[str]):
2149
+ def __validate_search_keys(self, search_keys: Dict[str, SearchKey], search_id: Optional[str] = None):
2151
2150
  if (search_keys is None or len(search_keys) == 0) and self.country_code is None:
2152
2151
  if search_id:
2153
2152
  self.logger.debug(f"search_id {search_id} provided without search_keys")
@@ -11,46 +11,49 @@ def get_runtime_params_custom_loss(
11
11
  runtime_parameters: RuntimeParameters,
12
12
  logger: Optional[logging.Logger] = None,
13
13
  ) -> RuntimeParameters:
14
+ if not loss:
15
+ return runtime_parameters
16
+
14
17
  if logger is None:
15
18
  logger = logging.getLogger()
16
- if loss is not None:
17
- selection_loss_reg = [
18
- "regression",
19
- "regression_l1",
20
- "huber",
21
- "poisson",
22
- "quantile",
23
- "mape",
24
- "mean_absolute_percentage_error",
25
- "gamma",
26
- "tweedie",
27
- ]
28
- selection_loss_binary = ["binary"]
29
- selection_loss_multi_clf = ["multiclass", "multiclassova", "multiclass_ova", "ova", "ovr"]
30
- use_custom_loss = (
31
- True
32
- if (
33
- (model_task_type == ModelTaskType.REGRESSION)
34
- and (loss in selection_loss_reg)
35
- or (model_task_type == ModelTaskType.BINARY)
36
- and (loss in selection_loss_binary)
37
- or (model_task_type == ModelTaskType.MULTICLASS)
38
- and (loss in selection_loss_multi_clf)
39
- )
40
- else False
19
+
20
+ selection_loss_reg = [
21
+ "regression",
22
+ "regression_l1",
23
+ "huber",
24
+ "poisson",
25
+ "quantile",
26
+ "mape",
27
+ "mean_absolute_percentage_error",
28
+ "gamma",
29
+ "tweedie",
30
+ ]
31
+ selection_loss_binary = ["binary"]
32
+ selection_loss_multi_clf = ["multiclass", "multiclassova", "multiclass_ova", "ova", "ovr"]
33
+ use_custom_loss = (
34
+ True
35
+ if (
36
+ (model_task_type == ModelTaskType.REGRESSION)
37
+ and (loss in selection_loss_reg)
38
+ or (model_task_type == ModelTaskType.BINARY)
39
+ and (loss in selection_loss_binary)
40
+ or (model_task_type == ModelTaskType.MULTICLASS)
41
+ and (loss in selection_loss_multi_clf)
41
42
  )
43
+ else False
44
+ )
42
45
 
43
- if use_custom_loss:
44
- runtime_parameters.properties["lightgbm_params_preselection.objective"] = loss
45
- runtime_parameters.properties["lightgbm_params_base.objective"] = loss
46
- runtime_parameters.properties["lightgbm_params_segment.objective"] = loss
47
- msg = bundle.get("loss_selection_info").format(loss)
48
- logger.info(msg)
49
- print(msg)
50
- else:
51
- msg = bundle.get("loss_selection_warn").format(loss, model_task_type)
52
- logger.warning(msg)
53
- print(msg)
46
+ if use_custom_loss:
47
+ runtime_parameters.properties["lightgbm_params_preselection.objective"] = loss
48
+ runtime_parameters.properties["lightgbm_params_base.objective"] = loss
49
+ runtime_parameters.properties["lightgbm_params_segment.objective"] = loss
50
+ msg = bundle.get("loss_selection_info").format(loss)
51
+ logger.info(msg)
52
+ print(msg)
53
+ else:
54
+ msg = bundle.get("loss_selection_warn").format(loss, model_task_type)
55
+ logger.warning(msg)
56
+ print(msg)
54
57
 
55
58
  return runtime_parameters
56
59
 
@@ -35,7 +35,7 @@ def validate_version(logger: logging.Logger):
35
35
  try:
36
36
  current_version = parse(__version__)
37
37
  latest_version = get_version("upgini")
38
- if current_version < latest_version: # type: ignore
38
+ if current_version < latest_version:
39
39
  msg = bundle.get("version_warning").format(current_version, latest_version)
40
40
  logger.warning(msg)
41
41
  print(msg)
@@ -1 +0,0 @@
1
- __version__ = "1.1.285a3418-1"
File without changes
File without changes
File without changes