Skip to content

Commit 3fcd051

Browse files
committed
ODSC-39261: fix the link
1 parent cca3c72 commit 3fcd051

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

docs/source/user_guide/model_registration/frameworks/automlmodel.rst

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ AutoMLModel
55

66
.. note::
77

8-
The ``ads.model.framework.automl_model.AutoMLModel`` class is deprecated. See this :ref:link <_Oralce_AutoMlx>`` for more detailed information.
8+
The ``ads.model.framework.automl_model.AutoMLModel`` class is deprecated. See this :ref:`link <_Oralce_AutoMlx>` for more detailed information.
99

1010
To deploy an AutoMlx model, use `GenericModel <../../../ads.model.html#ads.model.generic_model.GenericModel>`__ class.
1111

@@ -58,7 +58,7 @@ Example
5858
Open ``automl_model_artifact/score.py`` and edit the code to instantiate the model class. The edits are highlighted -
5959

6060
.. code-block:: python3
61-
:emphasize-lines: 21,30
61+
:emphasize-lines: 21,22,23,24,25,26,27,28,29,30,101,102,103,104,105,106,107,108,109,110,171
6262
6363
# score.py 1.0 generated by ADS 2.8.1 on 20230226_214703
6464
import json
@@ -91,7 +91,6 @@ Open ``automl_model_artifact/score.py`` and edit the code to instantiate the mod
9191
logger.addHandler(handler)
9292
automl.init(engine="local", engine_opts={"n_jobs": 1}, logger=logger)
9393
94-
9594
@lru_cache(maxsize=10)
9695
def load_model(model_file_name=model_name):
9796
"""
@@ -162,16 +161,15 @@ Open ``automl_model_artifact/score.py`` and edit the code to instantiate the mod
162161
json_data = data.get('data', data) if isinstance(data, dict) else data
163162
164163
if task and task == "forecasting":
165-
if data_type:
164+
try:
166165
data_type = data_type.split("'")[1]
167-
try:
168-
module, spec = ".".join(data_type.split(".")[:-1]), data_type.split(".")[-1]
169-
lib = importlib.import_module(name=module)
170-
func = getattr(lib, spec)
171-
return pd.DataFrame(index=func(json_data))
172-
except:
173-
logging.warning("Cannot autodetect the type of the input data. By default, convert input data to pd.DatetimeIndex and feed the model an empty pandas DataFrame with index as input data. If assumption is not correct, modify the score.py and check with .verify() before saving model with .save().")
174-
return pd.DataFrame(index=pd.DatetimeIndex(json_data))
166+
module, spec = ".".join(data_type.split(".")[:-1]), data_type.split(".")[-1]
167+
lib = importlib.import_module(name=module)
168+
func = getattr(lib, spec)
169+
return pd.DataFrame(index=func(json_data))
170+
except:
171+
logging.warning("Cannot autodetect the type of the model input data. By default, convert input data to pd.DatetimeIndex and feed the model with an empty pandas DataFrame with index as input data. If assumption is not correct, modify the score.py and check with .verify() before saving model with .save().")
172+
return pd.DataFrame(index=pd.DatetimeIndex(json_data))
175173
if "pandas.core.series.Series" in data_type:
176174
return pd.Series(json_data)
177175
if "pandas.core.frame.DataFrame" in data_type or isinstance(json_data, str):
@@ -240,7 +238,7 @@ Open ``automl_model_artifact/score.py`` and edit the code to instantiate the mod
240238
return {'prediction': yhat}
241239
242240
243-
Verify score.py changes by running inference locally
241+
Verify score.py changes by running inference locally.
244242
.. code-block:: python3
245243
246244
automl_model.verify(X_test.iloc[:2], auto_serialize_data=True)

0 commit comments

Comments
 (0)