Transformations > Python transformation > Resource files
  

Resource files

The Python transformation uses resource files and the Python code to define the transformation functionality. If you use a pre-trained model, you specify the pre-trained model as a resource file in the Python transformation.
The Python transformation contains the following components:
Resource file
A file that contains the resources that you access in the Python code.
The file can be a pre-trained model that has been trained on a larger data set outside Data Integration. You can use the pre-trained model to classify data or make predictions based on the data that you pass to the Python transformation. You can access the pre-trained model in the Python code.
Runtime environment
Add resource files based on the type of runtime environment. If you reference resource files in the Python code, add the resource files to the same directory. To maintain consistency, you can store the resource files in a dedicated folder named python_resources.
Consider the following guidelines:
Serverless runtime environment
Add resource files in the supplementary file location.
If you update the Python installation or resource files, you must redeploy the serverless runtime environment for the changes to take effect.
For more information about the supplementary file location, see Administrator in the Administrator help.
Python code
The Python code that the Python transformation uses to process data that you pass to the transformation. When you write Python code, you might reconstruct input variables, load a pre-trained model, or define output variables.