Set Up the SDK for Data Attribute Recommendation
- How to set up a virtual environment
- How to install the SDK for Data Attribute Recommendation
Use Data Attribute Recommendation (one of the SAP AI Business Services in SAP Business Technology Platform) to classify entities such as products, stores and users into multiple classes, using free text, numbers and categories. For more information, see Data Attribute Recommendation help portal documentation. For the definition of specific terms, see Concepts.
The Data Attribute Recommendation service provides a REST API to communicate and interact with your service instance. The Python SDK for Data Attribute Recommendation provides an implementation that allows you to easily consume the APIs of the service without having to write your own code. It also serves as a reference implementation and can be easily transferred into other programming environments and languages.
The SDK is available in GitHub.
- Step 1
First, you need to make sure that you have Python installed. Ideally, you have a Python version from 3.5 up to 3.8 as those are actively supported by the SDK.
In case you have a Python installation, it will output the version. If you have a version lower than 3.5 head over here and install an up-to-date version that is supported by the SDK.
command not foundis printed, you do not have Python installed. Head over here and install an up-to-date version that is supported by the SDK. Then, close down and open up a new command prompt or terminal and run the command
python --versionagain to check if the installation was successful.
- Step 2
Next, you will set up a virtual environment using the Python package
virtualenv. With this package you avoid installing Python packages globally which could break system tools or other projects.
You can tell that the environment is activated as it is added to your current path.
- Step 3
Finally, you can install the SDK of Data Attribute Recommendation.
Within your virtual environment, run the command
pip install data-attribute-recommendation-sdkto install the SDK.
You will then receive a similar output as above.
As a first test, enter the command
python -c "import sap.aibus.dar.client"to import the SDK. If there is no error the installation was successful and you can move onto the next tutorial.
- Step 4
What are virtual environments in Python used for?