oracle-ads 2.13.17__py3-none-any.whl → 2.13.18rc0__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.
@@ -18,13 +18,14 @@ from ads.opctl.operator.lowcode.common.utils import (
18
18
  get_frequency_of_datetime,
19
19
  )
20
20
 
21
- from ..const import ForecastOutputColumns, SupportedModels
21
+ from ..const import ForecastOutputColumns, SupportedModels, TROUBLESHOOTING_GUIDE
22
22
  from ..operator_config import ForecastOperatorConfig
23
23
 
24
24
 
25
25
  class HistoricalData(AbstractData):
26
- def __init__(self, spec, historical_data=None):
27
- super().__init__(spec=spec, name="historical_data", data=historical_data)
26
+ def __init__(self, spec, historical_data=None, subset=None):
27
+ super().__init__(spec=spec, name="historical_data", data=historical_data, subset=subset)
28
+ self.subset = subset
28
29
 
29
30
  def _ingest_data(self, spec):
30
31
  try:
@@ -48,25 +49,29 @@ class HistoricalData(AbstractData):
48
49
  f"{SupportedModels.AutoMLX} requires data with a frequency of at least one hour. Please try using a different model,"
49
50
  " or select the 'auto' option."
50
51
  )
51
- raise InvalidParameterError(message)
52
+ raise InvalidParameterError(f"{message}"
53
+ f"\nPlease refer to the troubleshooting guide at {TROUBLESHOOTING_GUIDE} for resolution steps.")
52
54
 
53
55
 
54
56
  class AdditionalData(AbstractData):
55
- def __init__(self, spec, historical_data, additional_data=None):
57
+ def __init__(self, spec, historical_data, additional_data=None, subset=None):
58
+ self.subset = subset
56
59
  if additional_data is not None:
57
- super().__init__(spec=spec, name="additional_data", data=additional_data)
60
+ super().__init__(spec=spec, name="additional_data", data=additional_data, subset=subset)
58
61
  self.additional_regressors = list(self.data.columns)
59
62
  elif spec.additional_data is not None:
60
- super().__init__(spec=spec, name="additional_data")
63
+ super().__init__(spec=spec, name="additional_data", subset=subset)
61
64
  add_dates = self.data.index.get_level_values(0).unique().tolist()
62
65
  add_dates.sort()
63
66
  if historical_data.get_max_time() > add_dates[-spec.horizon]:
64
67
  raise DataMismatchError(
65
68
  f"The Historical Data ends on {historical_data.get_max_time()}. The additional data horizon starts on {add_dates[-spec.horizon]}. The horizon should have exactly {spec.horizon} dates after the Historical at a frequency of {historical_data.freq}"
69
+ f"\nPlease refer to the troubleshooting guide at {TROUBLESHOOTING_GUIDE} for resolution steps."
66
70
  )
67
71
  elif historical_data.get_max_time() != add_dates[-(spec.horizon + 1)]:
68
72
  raise DataMismatchError(
69
73
  f"The Additional Data must be present for all historical data and the entire horizon. The Historical Data ends on {historical_data.get_max_time()}. The additonal data horizon starts after {add_dates[-(spec.horizon+1)]}. These should be the same date."
74
+ f"\nPlease refer to the troubleshooting guide at {TROUBLESHOOTING_GUIDE} for resolution steps."
70
75
  )
71
76
  else:
72
77
  self.name = "additional_data"
@@ -127,6 +132,7 @@ class ForecastDatasets:
127
132
  historical_data=None,
128
133
  additional_data=None,
129
134
  test_data=None,
135
+ subset=None, # New parameter for subsetting by group
130
136
  ):
131
137
  """Instantiates the DataIO instance.
132
138
 
@@ -134,26 +140,28 @@ class ForecastDatasets:
134
140
  ----------
135
141
  config: ForecastOperatorConfig
136
142
  The forecast operator configuration.
143
+ subset: list, optional
144
+ List of group keys to subset the data on initialization.
137
145
  """
146
+ self.config = config # Store the config for later use
138
147
  self.historical_data: HistoricalData = None
139
148
  self.additional_data: AdditionalData = None
140
149
  self._horizon = config.spec.horizon
141
150
  self._datetime_column_name = config.spec.datetime_column.name
142
151
  self._target_col = config.spec.target_column
143
152
  if historical_data is not None:
144
- self.historical_data = HistoricalData(config.spec, historical_data)
153
+ self.historical_data = HistoricalData(config.spec, historical_data, subset=subset)
145
154
  self.additional_data = AdditionalData(
146
- config.spec, self.historical_data, additional_data
155
+ config.spec, self.historical_data, additional_data, subset=subset
147
156
  )
148
157
  else:
149
- self._load_data(config.spec)
158
+ self._load_data(config.spec, subset=subset)
150
159
  self.test_data = TestData(config.spec, test_data)
151
160
 
152
- def _load_data(self, spec):
161
+ def _load_data(self, spec, subset=None):
153
162
  """Loads forecasting input data."""
154
- self.historical_data = HistoricalData(spec)
155
- self.additional_data = AdditionalData(spec, self.historical_data)
156
-
163
+ self.historical_data = HistoricalData(spec, subset=subset)
164
+ self.additional_data = AdditionalData(spec, self.historical_data, subset=subset)
157
165
  if spec.generate_explanations and spec.additional_data is None:
158
166
  logger.warning(
159
167
  "Unable to generate explanations as there is no additional data passed in. Either set generate_explanations to False, or pass in additional data."
@@ -210,6 +218,7 @@ class ForecastDatasets:
210
218
  except Exception as e:
211
219
  raise InvalidParameterError(
212
220
  f"Unable to retrieve series id: {s_id} from data. Available series ids are: {self.list_series_ids()}"
221
+ f"\nPlease refer to the troubleshooting guide at {TROUBLESHOOTING_GUIDE} for resolution steps."
213
222
  ) from e
214
223
 
215
224
  def get_horizon_at_series(self, s_id):
@@ -291,6 +300,7 @@ class ForecastOutput:
291
300
  if not overwrite and series_id in self.series_id_map:
292
301
  raise ValueError(
293
302
  f"Attempting to update ForecastOutput for series_id {series_id} when this already exists. Set overwrite to True."
303
+ f"\nPlease refer to the troubleshooting guide at {TROUBLESHOOTING_GUIDE} for resolution steps."
294
304
  )
295
305
  forecast = self._check_forecast_format(forecast)
296
306
  self.series_id_map[series_id] = forecast
@@ -331,6 +341,7 @@ class ForecastOutput:
331
341
  except KeyError as e:
332
342
  raise ValueError(
333
343
  f"Attempting to update output for series: {series_id}, however no series output has been initialized."
344
+ f"\nPlease refer to the troubleshooting guide at {TROUBLESHOOTING_GUIDE} for resolution steps."
334
345
  ) from e
335
346
 
336
347
  if (output_i.shape[0] - self.horizon) == len(fit_val):
@@ -351,18 +362,21 @@ class ForecastOutput:
351
362
  if len(forecast_val) != self.horizon:
352
363
  raise ValueError(
353
364
  f"Attempting to set forecast along horizon ({self.horizon}) for series: {series_id}, however forecast is only length {len(forecast_val)}"
365
+ f"\nPlease refer to the troubleshooting guide at {TROUBLESHOOTING_GUIDE} for resolution steps."
354
366
  )
355
367
  output_i["forecast_value"].iloc[-self.horizon :] = forecast_val
356
368
 
357
369
  if len(upper_bound) != self.horizon:
358
370
  raise ValueError(
359
371
  f"Attempting to set upper_bound along horizon ({self.horizon}) for series: {series_id}, however upper_bound is only length {len(upper_bound)}"
372
+ f"\nPlease refer to the troubleshooting guide at {TROUBLESHOOTING_GUIDE} for resolution steps."
360
373
  )
361
374
  output_i[self.upper_bound_name].iloc[-self.horizon :] = upper_bound
362
375
 
363
376
  if len(lower_bound) != self.horizon:
364
377
  raise ValueError(
365
378
  f"Attempting to set lower_bound along horizon ({self.horizon}) for series: {series_id}, however lower_bound is only length {len(lower_bound)}"
379
+ f"\nPlease refer to the troubleshooting guide at {TROUBLESHOOTING_GUIDE} for resolution steps."
366
380
  )
367
381
  output_i[self.lower_bound_name].iloc[-self.horizon :] = lower_bound
368
382
 
@@ -490,3 +504,25 @@ class ForecastResults:
490
504
 
491
505
  def get_errors_dict(self):
492
506
  return getattr(self, "errors_dict", None)
507
+
508
+ def merge(self, other: 'ForecastResults'):
509
+ """Merge another ForecastResults object into this one."""
510
+ # Merge DataFrames if they exist, else just set
511
+ for attr in [
512
+ 'forecast', 'metrics', 'test_metrics', 'local_explanations', 'global_explanations', 'model_parameters', 'models', 'errors_dict']:
513
+ val_self = getattr(self, attr, None)
514
+ val_other = getattr(other, attr, None)
515
+ if val_self is not None and val_other is not None:
516
+ if isinstance(val_self, pd.DataFrame) and isinstance(val_other, pd.DataFrame):
517
+ setattr(self, attr, pd.concat([val_self, val_other], ignore_index=True, axis=0))
518
+ elif isinstance(val_self, dict) and isinstance(val_other, dict):
519
+ val_self.update(val_other)
520
+ setattr(self, attr, val_self)
521
+ elif isinstance(val_self, list) and isinstance(val_other, list):
522
+ setattr(self, attr, val_self + val_other)
523
+ else:
524
+ # If not mergeable, just keep self's value
525
+ pass
526
+ elif val_other is not None:
527
+ setattr(self, attr, val_other)
528
+ return self
@@ -10,7 +10,10 @@ import pandas as pd
10
10
  from ads.opctl import logger
11
11
  from ads.opctl.operator.lowcode.common.const import DataColumns
12
12
  from ads.opctl.operator.lowcode.common.errors import InsufficientDataError
13
- from ads.opctl.operator.lowcode.forecast.const import BACKTEST_REPORT_NAME
13
+ from ads.opctl.operator.lowcode.forecast.const import (
14
+ BACKTEST_REPORT_NAME,
15
+ TROUBLESHOOTING_GUIDE,
16
+ )
14
17
  from ads.opctl.operator.lowcode.forecast.model.factory import SupportedModels
15
18
 
16
19
  from .model.forecast_datasets import ForecastDatasets
@@ -79,6 +82,7 @@ class ModelEvaluator:
79
82
  raise InsufficientDataError(
80
83
  "Insufficient data to evaluate multiple models. Please specify a model "
81
84
  "instead of using auto-select."
85
+ f"\nPlease refer to the troubleshooting guide at {TROUBLESHOOTING_GUIDE} for resolution steps."
82
86
  )
83
87
  training_datasets = [
84
88
  sampled_historical_data[sampled_historical_data[date_col] <= cut_off_date]
@@ -223,6 +227,7 @@ class ModelEvaluator:
223
227
  model = SupportedModels.Prophet
224
228
  logger.error(
225
229
  f"Running {model} model as auto-select failed with the following error: {e.message}"
230
+ f"\nPlease refer to the troubleshooting guide at {TROUBLESHOOTING_GUIDE} for resolution steps."
226
231
  )
227
232
  return model
228
233
  nonempty_metrics = {
@@ -459,6 +459,7 @@ spec:
459
459
  - automlx
460
460
  - autots
461
461
  - auto-select
462
+ - auto-select-series
462
463
 
463
464
  model_kwargs:
464
465
  type: dict
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oracle_ads
3
- Version: 2.13.17
3
+ Version: 2.13.18rc0
4
4
  Summary: Oracle Accelerated Data Science SDK
5
5
  Keywords: Oracle Cloud Infrastructure,OCI,Machine Learning,ML,Artificial Intelligence,AI,Data Science,Cloud,Oracle,GenAI,Generative AI,Forecast,Anomaly,Document Understanding,Anomaly Detection
6
6
  Author: Oracle Data Science
@@ -698,10 +698,10 @@ ads/opctl/operator/lowcode/anomaly/model/randomcutforest.py,sha256=eZVtLTRCcA6Er
698
698
  ads/opctl/operator/lowcode/anomaly/model/tods.py,sha256=_v0KkdTKD3nqzOu3P5tE7bSV63Jy91h6Hr88Eequ0RU,4175
699
699
  ads/opctl/operator/lowcode/common/__init__.py,sha256=rZrmh1nho40OCeabXCNWtze-mXi-PGKetcZdxZSn3_0,204
700
700
  ads/opctl/operator/lowcode/common/const.py,sha256=1dUhgup4L_U0s6BSYmgLPpZAe6xqfSHPPoLqW0j46U8,265
701
- ads/opctl/operator/lowcode/common/data.py,sha256=_0UbW-A0kVQjNOO2aeZoRiebgmKqDqcprPPjZ6KDWdk,4188
701
+ ads/opctl/operator/lowcode/common/data.py,sha256=kGR7k2tQofb4qbFgEv8QywCIKrVQEk1gBpIuA_1BOuY,4628
702
702
  ads/opctl/operator/lowcode/common/errors.py,sha256=LvQ_Qzh6cqD6uP91DMFFVXPrcc3010EE8LfBH-CH0ho,1534
703
- ads/opctl/operator/lowcode/common/transformations.py,sha256=n-Yac9WtI9GLEc5sDKSq75-2q0j59bR_pxlV5EAmkO0,11048
704
- ads/opctl/operator/lowcode/common/utils.py,sha256=9wVM7lNZX_RRO0MVxZrN0FkWBPZweKq_D3_0ON7wjnM,12159
703
+ ads/opctl/operator/lowcode/common/transformations.py,sha256=byjx1_ALRmE0U3j7mt2np-V6v5TXrx6HT2kRTF3Aphk,19869
704
+ ads/opctl/operator/lowcode/common/utils.py,sha256=pKUcyJWopMbZQbbMXuJc1rR1VJIz2o_6RQbsy3znCfE,12486
705
705
  ads/opctl/operator/lowcode/feature_store_marketplace/MLoperator,sha256=JO5ulr32WsFnbpk1KN97h8-D70jcFt1kRQ08UMkP4rU,346
706
706
  ads/opctl/operator/lowcode/feature_store_marketplace/README.md,sha256=fN9ROzOPdEZdRgSP_uYvAmD5bD983NC7Irfe_D-mvrw,1356
707
707
  ads/opctl/operator/lowcode/feature_store_marketplace/__init__.py,sha256=rZrmh1nho40OCeabXCNWtze-mXi-PGKetcZdxZSn3_0,204
@@ -718,23 +718,24 @@ ads/opctl/operator/lowcode/feature_store_marketplace/models/mysql_config.py,sha2
718
718
  ads/opctl/operator/lowcode/feature_store_marketplace/models/serializable_yaml_model.py,sha256=Fd5K1q30mIyCbU6WDH8nDXyCJFlo_kSAEKxqr4dQSSc,1135
719
719
  ads/opctl/operator/lowcode/forecast/MLoperator,sha256=xM8yBUQObjG_6Mg36f3Vv8b9N3L8_5RUZJE2riOjXuw,5981
720
720
  ads/opctl/operator/lowcode/forecast/README.md,sha256=kbCCEdo-0pwKlZp9ctnWUK6Z31n69IsnG0i26b202Zg,9768
721
- ads/opctl/operator/lowcode/forecast/__init__.py,sha256=sAqmLhogrLXb3xI7dPOj9HmSkpTnLh9wkzysuGd8AXk,204
722
- ads/opctl/operator/lowcode/forecast/__main__.py,sha256=FTQhYCZEAbQO2sCOpepermKimSktFd9pERNu1rC-K3A,2926
721
+ ads/opctl/operator/lowcode/forecast/__init__.py,sha256=CIcan-f0OAJR8JRMmPKlh-PXI1dTuOUnHS97eHa8F4A,243
722
+ ads/opctl/operator/lowcode/forecast/__main__.py,sha256=k5VltDUfkEKOgz09zqsu9ljuixd7iVEN9e9rPILyrl4,4951
723
723
  ads/opctl/operator/lowcode/forecast/cmd.py,sha256=uwU-QvnYwxoRFXZv7_JFkzAUnjTNoSsHEme2FF-9Rl0,1151
724
- ads/opctl/operator/lowcode/forecast/const.py,sha256=Vt03VuFCbm5y9y-NomJsLX6wd3GzWwcCx7di8cnQ9dY,2611
724
+ ads/opctl/operator/lowcode/forecast/const.py,sha256=55wUyJQJfItsL_bEZvwpaoRm706D_s3dmFLosxByn8Q,2783
725
725
  ads/opctl/operator/lowcode/forecast/environment.yaml,sha256=eVMf9pcjADI14_GRGdZOB_gK5_MyG_-cX037TXqzFho,330
726
- ads/opctl/operator/lowcode/forecast/errors.py,sha256=X9zuV2Lqb5N9FuBHHshOFYyhvng5r9KGLHnQijZ5b8c,911
727
- ads/opctl/operator/lowcode/forecast/model_evaluator.py,sha256=crtCQ4KIWCueOf2zU-AKD_i3h_cJA_-qAGakdgBazVI,10257
726
+ ads/opctl/operator/lowcode/forecast/errors.py,sha256=2SrdsIPEXKDs4iYvUV9oeBcXwdHE3pUl5bZaiPCJQL4,1205
727
+ ads/opctl/operator/lowcode/forecast/meta_selector.py,sha256=whM33RK68u0v41UOwy9Ly46jlsFictzrfmq1TFNYRJw,13505
728
+ ads/opctl/operator/lowcode/forecast/model_evaluator.py,sha256=2nqRagzVgi21SOyjbVvDBtyWS5OdFhrLE_ADDB5VqpM,10517
728
729
  ads/opctl/operator/lowcode/forecast/operator_config.py,sha256=3pJzgbSqgPzE7vkce6KkthPQJEgWRRdDOAf1l6aSZpg,8318
729
- ads/opctl/operator/lowcode/forecast/schema.yaml,sha256=RoNwjg5jxXMbljtregMkV_rJbax8ir7zdJltC5YfYM8,12438
730
+ ads/opctl/operator/lowcode/forecast/schema.yaml,sha256=5ipXmlGV9Opxw-KaPOCToWR4AMb71UtRZi2RlOeHta8,12467
730
731
  ads/opctl/operator/lowcode/forecast/utils.py,sha256=00prJFK1F3esHlPsPp1WSJ3YoT0NK95f3cH2qNH8AJQ,13578
731
732
  ads/opctl/operator/lowcode/forecast/model/__init__.py,sha256=sAqmLhogrLXb3xI7dPOj9HmSkpTnLh9wkzysuGd8AXk,204
732
733
  ads/opctl/operator/lowcode/forecast/model/arima.py,sha256=PvHoTdDr6RIC4I-YLzed91td6Pq6uxbgluEdu_h0e3c,11766
733
- ads/opctl/operator/lowcode/forecast/model/automlx.py,sha256=f11WY1gsGrUIuzbgJd0c-t1nM3416nAxqj_ylvYtC7k,23669
734
+ ads/opctl/operator/lowcode/forecast/model/automlx.py,sha256=PVUslP6Qae3glD3xkgN77bTH9ilTeHOESW40VDe_jgw,23661
734
735
  ads/opctl/operator/lowcode/forecast/model/autots.py,sha256=UThBBGsEiC3WLSn-BPAuNWT_ZFa3bYMu52keB0vvSt8,13137
735
- ads/opctl/operator/lowcode/forecast/model/base_model.py,sha256=ENrizwJwhHbJa8DPMqCDEUKqwQaGfR5-fYdTxreQrHU,36613
736
- ads/opctl/operator/lowcode/forecast/model/factory.py,sha256=5a9A3ql-bU412BiTB20ob6OxQlkdk8z_tGONMwDXT1k,3900
737
- ads/opctl/operator/lowcode/forecast/model/forecast_datasets.py,sha256=2NsWE2WtD_O7uAXw42_3tmG3vb5lk3mdnzCZTph4hao,18903
736
+ ads/opctl/operator/lowcode/forecast/model/base_model.py,sha256=X3s7qhHUbExicFq61UG3876LWAQEUiSlpTjGFnib3IY,40401
737
+ ads/opctl/operator/lowcode/forecast/model/factory.py,sha256=odJAKV1rtu1wkAgDoPy_n4viJCpxnUUzPlJvyMYUr0c,5234
738
+ ads/opctl/operator/lowcode/forecast/model/forecast_datasets.py,sha256=b141jsR7k8qCaUA-_xgjtyNfR-MMUlnMNgqGa5OhBeA,21619
738
739
  ads/opctl/operator/lowcode/forecast/model/ml_forecast.py,sha256=t5x6EBxOd7XwfT3FGdt-n9gscxaHMm3R2A4Evvxbj38,9646
739
740
  ads/opctl/operator/lowcode/forecast/model/neuralprophet.py,sha256=-AS3PPd8Fqn1uaMybJwTnFbmIfUxNPDlgYjGtjy9-E8,19944
740
741
  ads/opctl/operator/lowcode/forecast/model/prophet.py,sha256=U0M3M7yzy7ea-mEG1c-dELL6t1Pf_LnnnbrZB08CG_Y,17402
@@ -860,8 +861,8 @@ ads/type_discovery/unknown_detector.py,sha256=yZuYQReO7PUyoWZE7onhhtYaOg6088wf1y
860
861
  ads/type_discovery/zipcode_detector.py,sha256=3AlETg_ZF4FT0u914WXvTT3F3Z6Vf51WiIt34yQMRbw,1421
861
862
  ads/vault/__init__.py,sha256=x9tMdDAOdF5iDHk9u2di_K-ze5Nq068x25EWOBoWwqY,245
862
863
  ads/vault/vault.py,sha256=hFBkpYE-Hfmzu1L0sQwUfYcGxpWmgG18JPndRl0NOXI,8624
863
- oracle_ads-2.13.17.dist-info/entry_points.txt,sha256=9VFnjpQCsMORA4rVkvN8eH6D3uHjtegb9T911t8cqV0,35
864
- oracle_ads-2.13.17.dist-info/licenses/LICENSE.txt,sha256=zoGmbfD1IdRKx834U0IzfFFFo5KoFK71TND3K9xqYqo,1845
865
- oracle_ads-2.13.17.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
866
- oracle_ads-2.13.17.dist-info/METADATA,sha256=W2KPCH2yRAHZF4aAF65yaOIZS6a4150R7hWAmbXRH5c,16994
867
- oracle_ads-2.13.17.dist-info/RECORD,,
864
+ oracle_ads-2.13.18rc0.dist-info/entry_points.txt,sha256=9VFnjpQCsMORA4rVkvN8eH6D3uHjtegb9T911t8cqV0,35
865
+ oracle_ads-2.13.18rc0.dist-info/licenses/LICENSE.txt,sha256=zoGmbfD1IdRKx834U0IzfFFFo5KoFK71TND3K9xqYqo,1845
866
+ oracle_ads-2.13.18rc0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
867
+ oracle_ads-2.13.18rc0.dist-info/METADATA,sha256=aBsbjgZiA8uiXNt9O106xFGvyCjnd-9PbftwTGXyolk,16997
868
+ oracle_ads-2.13.18rc0.dist-info/RECORD,,