Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

May Developer Challenge - SAP AI Services - Week 3

noravonthenen
Developer Advocate
Developer Advocate

Welcome to week 3 of the AI Developer Challenge! I am so excited about every single submission! Now I don’t know about you but in my family, we love avocado! Especially my youngest could eat it all the time. Let’s use the Data Attribute Recommendation service to build an avocado price prediction engine! With Data Attribute Recommendation you can train regression as well as classification models and you can use the SAP AI Launchpad, Postman, Swagger or the AI API Python SDK to implement your use case! With Data Attribute Recommendation you need to specify a model template or a business blueprint to specify what kind of algorithm should be used.

For this challenge we will use the regression model template to implement an avocado price predictor! If you do not like avocado, feel free to come up with another use case and search for a fitting dataset (e.g. here).

This week we start by uploading and preparing our dataset schema and our dataset! For that we will be using the AI API which is a standardized way to interact with different AI runtimes and services such as SAP AI Core or Data Attribute Recommendation.

  1. Go to your BTP trial account and create a DAR instance (you can use the booster): https://developers.sap.com/tutorials/cp-aibus-dar-service-instance.html
  2. Download this dataset
  3. Download the postman collection for the Data Attribute Recommendation service and import the folder to Postman
  4. Go to the environment tab on the left and add the information from your DAR service key from step 1.
    1. authUrl = url from the uaa section in your .json file
    2. url = urlnoravonthenen_7-1715759911268.png
  5. Make sure to select the correct environment and go back to the Collections tab to create a token with the Get XSUAA OAuth Token GET request in the Authorization folder. If everything is set up correctly it will take the url, username and password from your environmental variables you configured in step 4. It will also assign the token to the correct variable in the environment for further use. Make sure to repeat this step once the token timed out.
  6. Create a dataset_schema.json file
  7. Go back to the Environments tab and assign a folder name (e.g. avocado_price_predictor) and a datasetSchemaFileRegression name (e.g. dataset_schema.json) as well as a datasetFileRegression name (e.g. avocado_data.csv) and also assign the scenarioIdRegression = '35cd9fbc-7290-4042-b6df-178d74c67363' or find the correct Scenario ID here.
  8. Upload a dataset schema with the PUT Upload Dataset Schema Regression request and make sure to upload your dataset_schema.json
  9. Upload this dataset with the PUT Upload Dataset Regression request
  10. Create a dataset schema artifact with the POST Create Dataset Schema Artifact Regression request (the required values were assigned automatically to your environment)
  11. Create a dataset artifact with the POST Create Dataset Artifact Regression request (the required values were assigned automatically to your environment)
  12. Learn more about AI API and the underlying concepts such as artifacts
  13. Submission is again a screenshot of the last POST request and the correct returned result:noravonthenen_6-1715759819554.png
  14. Stay tuned for next week to train your model!

 Week 1 challenge

Week 2 challenge

9 REPLIES 9

geek
Participant
0 Kudos

geek_0-1715790561667.png

Update: For anybody else who's not a regular Postman user, installing the Desktop Agent fixes this. 

0 Kudos

After much wailing and gnashing of teeth:

geek_0-1715871963374.png

moh_ali_square
Participant

Hi, 

Update: I got it right. Thanks to Mio for help .

 DAR week 3 submissionDAR week 3 submission

 

I updated the enviorment with value of scenarioIdRegression

Collection environment variablesCollection environment variables

I had an issue with the last two steps, I uploaded the dataset schema and the dataset. but there is API error related to scenarioID!

Did I miss anything?

below screenshot for my submission, and another screenshot shows that dataset was uploaded, when I tried to upload it again, I got a message that it is already there. 

Post request for Dataset.Post request for Dataset.

 

PUT request for datasetPUT request for dataset

MioYasutake
Active Contributor

My submission for week 3.

MioYasutake_0-1715804377888.png

I encountered the same error as @moh_ali_square posted. As the document says "scenarioId refer to pre-existing values", I tried to find where the scenarioId is defined. I found it by calling the following endpoint. I hope this is the right approach. 

MioYasutake_1-1715804574225.png

 

 

0 Kudos

For anyone trying to follow this:


10. Create a dataset schema artifact with the POST Create Dataset Schema Artifact Regression request (the required values were assigned automatically to your environment)


The scenarioid is not automatically assigned.

@MioYasutake thanks a lot for catching that! I updated it in the post 🙂

Nagarajan-K
Explorer
0 Kudos

NagarajanK_0-1715878716059.png

Thanks @MioYasutake for the tip in your response which helped in moving forward. 

Alpesa1990
Participant
0 Kudos

My submission for this this task.

Alpesa1990_0-1715959713145.png

 

emiliocampo
Explorer
0 Kudos

Submission for week 3

emiliocampo_0-1716059889352.png