cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Personalized Recommendation - SAP BTP

bogdanvisinari
Discoverer
0 Likes
260

Hi,

I am testing the Personalized Recommendation entitlement and while the /next-items API seems to be working fine with basic parameters used in the request body, if I am trying to use the "boosting_attributes" (as suggested in https://help.sap.com/docs/personalized-recommendation/personalized-recommendation/next-item-recommen...), the response comes back as 422:

Serving instance internal exception

This is how my POST request body looks like:

 

{
  "user": "8",
  "items_ls": ["49"],
  "boosting_attributes": [
      {
         "categoricalFeatures":{
            "categories":{
               "values":[
                  "Drama",
                  "Comedy"
               ],
               "weights":[
                  0.2,
                  0.4
               ]
            }
         }
      }
   ],
  "k": 3,
  "explain": true
}

 

Any help would be much appreciated.

Thank you.

Accepted Solutions (0)

Answers (1)

Answers (1)

saimunlee
Product and Topic Expert
Product and Topic Expert
0 Likes

Apologies for the late reply but better late than never!

There is a slight error in the request payload where the "boosting_attributes" values should be a dict instead of a list.

The correct request payload should be:

{
  "user": "8",
  "items_ls": [
    "49"
  ],
  "boosting_attributes": {
    "categoricalFeatures": {
      "categories": {
        "values": [
          "Drama",
          "Comedy"
        ],
        "weights": [
          0.2,
          0.4
        ]
      }
    }
  },
  "k": 3,
  "explain": true
}