0

We have trained the recommendation model using WideAndDeepRecommender model in the Azure ML Designer and deployed the model in the AKS cluster. As we know the Azure WideAndDeepRecommender we can have two different types of the score

  1. Predict ratings
  2. Recommend items

Predict rating score Recommend items

While we pass the test data to WideAndDeepRecommender model deployed in the AKS cluster We can predict the Predict ratings for giving input but unable to predict the Recommend items While we predict the Recommended items we are facing the below error

2023-06-09 09:22:15,326 E [65] azmlinfsrv - Encountered Exception: Traceback (most recent call last): File "/azureml-envs/azureml_92cded412e113f8d82c9a5108fbe8109/lib/python3.8/site-packages/azureml_inference_server_http/server/user_script.py", line 130, in invoke_run run_output = self._wrapped_user_run(**run_parameters, request_headers=dict(request.headers)) File "/azureml-envs/azureml_92cded412e113f8d82c9a5108fbe8109/lib/python3.8/site-packages/azureml_inference_server_http/server/user_script.py", line 154, in self._wrapped_user_run = lambda request_headers, **kwargs: self._user_run(**kwargs) File "/structure/azureml-app/deployment_source_directory/score.py", line 42, in run result_dfd, = ScoreWideAndDeepRecommenderModule().run(**score_params) File "/azureml-envs/azureml_92cded412e113f8d82c9a5108fbe8109/lib/python3.8/site-packages/azureml/designer/modules/recommendation/dnn/common/entry_utils.py", line 44, in wrapper return func(obj, **kwargs) File "/azureml-envs/azureml_92cded412e113f8d82c9a5108fbe8109/lib/python3.8/site-packages/azureml/designer/modules/recommendation/dnn/wide_and_deep/score/score_wide_and_deep_recommender.py", line 141, in run scorer = scorer_class( File "/azureml-envs/azureml_92cded412e113f8d82c9a5108fbe8109/lib/python3.8/site-packages/azureml/designer/modules/recommendation/dnn/wide_and_deep/score/wide_and_deep_scorers.py", line 350, in init self.predictions_buffer = pd.DataFrame({}, columns=[USER_COLUMN, ITEM_COLUMN, SCORED_RATING]) File "/azureml-envs/azureml_92cded412e113f8d82c9a5108fbe8109/lib/python3.8/site-packages/pandas/core/frame.py", line 435, in init mgr = init_dict(data, index, columns, dtype=dtype) File "/azureml-envs/azureml_92cded412e113f8d82c9a5108fbe8109/lib/python3.8/site-packages/pandas/core/internals/construction.py", line 239, in init_dict val = construct_1d_arraylike_from_scalar(np.nan, len(index), nan_dtype) File "/azureml-envs/azureml_92cded412e113f8d82c9a5108fbe8109/lib/python3.8/site-packages/pandas/core/dtypes/cast.py", line 1440, in construct_1d_arraylike_from_scalar dtype = dtype.dtype

Please provide your thought on it and feel free to ask any questions Thanks in advance.

1 Answers1

-1

The error you are getting is due to the WideAndDeepRecommender model deployed in the AKS cluster is only trained to predict ratings. In order to predict items, you need to retrain the model with a different set of data that includes both ratings and item IDs. By default the score parameters are for Rating Prediction.

Image

Make sure to select these parameters before training:

Image

Image

If you have trained for both rating and item IDs then based on the error message, it appears that there is an issue with the input data format.

To resolve this issue, please ensure that your input data is correctly formatted according to the Azure Machine Learning documentation.

Input data format: Ensure that your input dataset is formatted correctly based on the scoring mode you are using (From Rated Items, From All Items, or From Unrated Items). The input dataset should contain the appropriate columns (user identifiers, item identifiers, and ratings) .

For more details please refer to: azure-docs/score-wide-and-deep-recommender.md at main · MicrosoftDocs/azure-docs · GitHub

Aswin
  • 4,090
  • 2
  • 4
  • 16
RishabhM
  • 525
  • 1
  • 5