Skip to content

Commit 0a6610e

Browse files
committed
changes to support new version
1 parent 06e99c3 commit 0a6610e

File tree

7 files changed

+15
-8
lines changed

7 files changed

+15
-8
lines changed

ads/opctl/operator/lowcode/anomaly/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ To run anomaly detection locally, create and activate a new conda environment (`
3838
- datapane
3939
- cerberus
4040
- oracle-automlx==23.4.1
41+
- oracle-automlx[classic]==23.4.1
4142
- "git+https://github.com/oracle/accelerated-data-science.git@feature/anomaly#egg=oracle-ads"
4243
```
4344

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ dependencies:
88
- datapane
99
- cerberus
1010
- oracle-automlx==23.4.1
11+
- oracle-automlx[classic]==23.4.1
1112
- "oracle-ads[anomaly]"

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,22 @@ class AutoMLXOperatorModel(AnomalyOperatorBaseModel):
1717
"""Class representing AutoMLX operator model."""
1818

1919
@runtime_dependency(
20-
module="automl",
20+
module="automlx",
2121
err_msg=(
22-
"Please run `pip3 install oracle-automlx==23.4.1` to "
23-
"install the required dependencies for automlx."
22+
"Please run `pip3 install oracle-automlx==23.4.1` and "
23+
"`pip3 install oracle-automlx[classic]==23.4.1` "
24+
"to install the required dependencies for automlx."
2425
),
2526
)
2627
def _build_model(self) -> pd.DataFrame:
28+
from automlx import init
29+
init(engine="ray", engine_opts={"ray_setup": {"_temp_dir": "/tmp/ray-temp"}})
2730
date_column = self.spec.datetime_column.name
2831
anomaly_output = AnomalyOutput(date_column=date_column)
2932

30-
time_budget = self.spec.model_kwargs.pop("time_budget", None)
3133
# Iterate over the full_data_dict items
3234
for target, df in self.datasets.full_data_dict.items():
33-
est = automl.Pipeline(task="anomaly_detection", **self.spec.model_kwargs)
35+
est = automlx.Pipeline(task="anomaly_detection", **self.spec.model_kwargs)
3436
est.fit(
3537
X=df,
3638
X_valid=self.X_valid_dict[target]
@@ -39,7 +41,6 @@ def _build_model(self) -> pd.DataFrame:
3941
y_valid=self.y_valid_dict[target]
4042
if self.y_valid_dict is not None
4143
else None,
42-
time_budget=time_budget,
4344
contamination=self.spec.contamination
4445
if self.y_valid_dict is not None
4546
else None,

ads/opctl/operator/lowcode/forecast/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ To run forecasting locally, create and activate a new conda environment (`ads-fo
4040
- sktime
4141
- optuna==2.9.0
4242
- oracle-automlx==23.4.1
43+
- oracle-automlx[forecasting]==23.4.1
4344
- oracle-ads>=2.9.0
4445
```
4546

ads/opctl/operator/lowcode/forecast/environment.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ dependencies:
1717
- autots[additional]
1818
- optuna==2.9.0
1919
- oracle-automlx==23.4.1
20+
- oracle-automlx[forecasting]==23.4.1

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ def preprocess(self, data, series_id=None):
5757
@runtime_dependency(
5858
module="automlx",
5959
err_msg=(
60-
"Please run `pip3 install oracle-automlx==23.4.1` to install the required dependencies for automlx."
60+
"Please run `pip3 install oracle-automlx==23.4.1` and "
61+
"`pip3 install oracle-automlx[forecasting]==23.4.1` "
62+
"to install the required dependencies for automlx."
6163
),
6264
)
6365
@runtime_dependency(

tests/operators/anomaly/test_anomaly_simple.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def test_load_datasets(model, data_dict):
212212

213213
# run(yaml_i, backend="operator.local", debug=False)
214214

215-
with open(f"{tmpdirname}/anomaly.yaml", "w") as f:
215+
with open(anomaly_yaml_filename, "w") as f:
216216
f.write(yaml.dump(yaml_i))
217217
sleep(0.5)
218218
subprocess.run(

0 commit comments

Comments
 (0)