Skip to content

Commit 5934b73

Browse files
authored
Merge branch 'main' into bug/mlforecast_datetime_column
2 parents 2e39598 + dc583b3 commit 5934b73

File tree

15 files changed

+36
-18
lines changed

15 files changed

+36
-18
lines changed

.github/workflows/run-forecast-unit-tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
strategy:
2828
fail-fast: false
2929
matrix:
30-
python-version: ["3.8"]
30+
python-version: ["3.8", "3.9", "3.10"]
3131

3232
steps:
3333
- uses: actions/checkout@v4
@@ -56,4 +56,7 @@ jobs:
5656
$CONDA/bin/conda init
5757
source /home/runner/.bashrc
5858
pip install -r test-requirements-operators.txt
59+
pip install "oracle-automlx[classic]>=24.2.0"
60+
pip install "oracle-automlx[forecasting]>=24.2.0"
61+
pip install pandas>=2.2.0
5962
python -m pytest -v -p no:warnings --durations=5 tests/operators/forecast

.github/workflows/run-operators-unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
strategy:
2828
fail-fast: false
2929
matrix:
30-
python-version: ["3.8"]
30+
python-version: ["3.8", "3.9", "3.10"]
3131

3232
steps:
3333
- uses: actions/checkout@v4

ads/opctl/operator/lowcode/anomaly/__main__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ def operate(operator_config: AnomalyOperatorConfig) -> None:
4040
AnomalyOperatorModelFactory.get_model(
4141
operator_config, datasets
4242
).generate_report()
43-
except Exception as e2:
43+
except Exception as ee:
4444
logger.debug(
45-
f"Failed to backup forecast with error {e2.args}. Raising original error."
45+
f"Failed to backup forecast with error {ee.args}. Raising original error."
4646
)
47-
raise e
47+
raise ee
4848
else:
4949
raise e
5050

ads/opctl/operator/lowcode/anomaly/model/autots.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def _generate_report(self):
9191
),
9292
]
9393
model_description = rc.Text(
94-
"The automlx model automatically pre-processes, selects and engineers "
94+
"The autots model automatically pre-processes, selects and engineers "
9595
"high-quality features in your dataset, which then given to an automatically "
9696
"chosen and optimized machine learning model.."
9797
)

ads/opctl/operator/lowcode/anomaly/schema.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,8 @@ spec:
349349
model:
350350
type: string
351351
required: false
352-
default: automlx
352+
default: autots
353353
allowed:
354-
- automlx
355354
- autots
356355
- auto
357356
meta:

ads/opctl/operator/lowcode/anomaly/utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*--
33

4-
# Copyright (c) 2023 Oracle and/or its affiliates.
4+
# Copyright (c) 2023, 2024 Oracle and/or its affiliates.
55
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
66

77
import os
@@ -77,5 +77,6 @@ def default_signer(**kwargs):
7777

7878
return default_signer(**kwargs)
7979

80+
8081
def select_auto_model(datasets, operator_config):
81-
return SupportedModels.AutoMLX
82+
return SupportedModels.AutoTS

ads/opctl/operator/lowcode/forecast/model/arima.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ def _train_model(self, i, s_id, df, model_kwargs):
125125
logger.debug("===========Done===========")
126126
except Exception as e:
127127
self.errors_dict[s_id] = {"model_name": self.spec.model, "error": str(e)}
128+
logger.debug(f"Encountered Error: {e}. Skipping.")
128129

129130
def _build_model(self) -> pd.DataFrame:
130131
full_data_dict = self.datasets.get_data_by_series()

ads/opctl/operator/lowcode/forecast/model/automlx.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def _build_model(self) -> pd.DataFrame:
8484
loglevel=logging.CRITICAL,
8585
)
8686
except Exception as e:
87-
logger.info("Ray already initialized")
87+
logger.info(f"Error. Has Ray already been initialized? Skipping. {e}")
8888

8989
full_data_dict = self.datasets.get_data_by_series()
9090

@@ -168,6 +168,7 @@ def _build_model(self) -> pd.DataFrame:
168168
"model_name": self.spec.model,
169169
"error": str(e),
170170
}
171+
logger.debug(f"Encountered Error: {e}. Skipping.")
171172

172173
logger.debug("===========Forecast Generated===========")
173174

ads/opctl/operator/lowcode/forecast/model/autots.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ def _build_model(self) -> pd.DataFrame:
209209
"model_name": self.spec.model,
210210
"error": str(e),
211211
}
212+
logger.debug(f"Encountered Error: {e}. Skipping.")
212213

213214
logger.debug("===========Done===========")
214215

ads/opctl/operator/lowcode/forecast/model/ml_forecast.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*--
3+
4+
# Copyright (c) 2024 Oracle and/or its affiliates.
5+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
16
import pandas as pd
27
import numpy as np
38

@@ -47,7 +52,6 @@ def preprocess(self, df, series_id):
4752
)
4853
def _train_model(self, data_train, data_test, model_kwargs):
4954
try:
50-
5155
import lightgbm as lgb
5256
from mlforecast import MLForecast
5357
from mlforecast.lag_transforms import ExpandingMean, RollingMean
@@ -159,6 +163,7 @@ def _train_model(self, data_train, data_test, model_kwargs):
159163
"model_name": self.spec.model,
160164
"error": str(e),
161165
}
166+
logger.debug(f"Encountered Error: {e}. Skipping.")
162167

163168
def _build_model(self) -> pd.DataFrame:
164169
data_train = self.datasets.get_all_data_long(include_horizon=False)

0 commit comments

Comments
 (0)