Method
createPredictionOperator POST
Copy POST

Create a new prediction operator.

Arguments:

REQUIRED KEY TYPE DESCRIPTION
Yes name str Name of the prediction operator.
Yes projectId str The unique ID of the associated project.
No sourceCode str Contents of a valid Python source code file. The source code should contain the function `predictFunctionName`, and the function 'initializeFunctionName' if defined.
No predictFunctionName str Name of the function found in the source code that will be executed to run predictions.
No initializeFunctionName str Name of the optional initialize function found in the source code. This function will generate anything used by predictions, based on input feature groups.
No featureGroupIds list List of feature groups that are supplied to the initialize function as parameters. Each of the parameters are materialized Dataframes. The order should match the initialize function's parameters.
No cpuSize str Size of the CPU for the prediction operator.
No memory int Memory (in GB) for the prediction operator.
No packageRequirements list List of package requirement strings. For example: ['numpy==1.2.3', 'pandas>=1.4.0']
No useGpu bool Whether this prediction operator needs gpu.
Note: The arguments for the API methods follow camelCase but for Python SDK underscore_case is followed.

Response:

KEY TYPE DESCRIPTION
success Boolean true if the call succeeded, false if there was an error
result PredictionOperator
KEY TYPE Description
name str The name for the prediction operator.
predictionOperatorId str The unique identifier of the prediction operator.
createdAt str Date and time at which the prediction operator was created.
updatedAt str Date and time at which the prediction operator was updated.
projectId str The project this prediction operator belongs to.
predictFunctionName str Name of the function found in the source code that will be executed to run predictions.
sourceCode str Python code used to make the prediction operator.
initializeFunctionName str Name of the optional initialize function found in the source code. This function will generate anything used by predictions, based on input feature groups.
notebookId str The unique string identifier of the notebook used to create or edit the prediction operator.
memory int Memory in GB specified for the prediction operator.
useGpu bool Whether this prediction operator is using gpu.
featureGroupIds list A list of Feature Group IDs used for initializing.
featureGroupTableNames list A list of Feature Group table names used for initializing.
codeSource CodeSource If a python model, information on the source code.
KEY TYPE Description
sourceType str The type of the source, one of TEXT, PYTHON, FILE_UPLOAD, or APPLICATION_CONNECTOR
sourceCode str If the type of the source is TEXT, the raw text of the function
applicationConnectorId str The Application Connector to fetch the code from
applicationConnectorInfo str Args passed to the application connector to fetch the code
packageRequirements list The pip package dependencies required to run the code
status str The status of the code and validations
error str If the status is failed, an error message describing what went wrong
publishingMsg dict Warnings in the source code
moduleDependencies list The list of internal modules dependencies required to run the code
latestPredictionOperatorVersion PredictionOperatorVersion The unique string identifier of the latest version.
KEY TYPE Description
predictionOperatorId str The unique identifier of the prediction operator.
predictionOperatorVersion str The unique identifier of the prediction operator version.
createdAt str Date and time at which the prediction operator was created.
updatedAt str Date and time at which the prediction operator was updated.
sourceCode str Python code used to make the prediction operator.
memory int Memory in GB specified for the prediction operator version.
useGpu bool Whether this prediction operator version is using gpu.
featureGroupIds list A list of Feature Group IDs used for initializing.
featureGroupVersions list A list of Feature Group version IDs used for initializing.
status str The current status of the prediction operator version.
error str The error message if the status failed.
codeSource CodeSource If a python model, information on the source code.
KEY TYPE Description
sourceType str The type of the source, one of TEXT, PYTHON, FILE_UPLOAD, or APPLICATION_CONNECTOR
sourceCode str If the type of the source is TEXT, the raw text of the function
applicationConnectorId str The Application Connector to fetch the code from
applicationConnectorInfo str Args passed to the application connector to fetch the code
packageRequirements list The pip package dependencies required to run the code
status str The status of the code and validations
error str If the status is failed, an error message describing what went wrong
publishingMsg dict Warnings in the source code
moduleDependencies list The list of internal modules dependencies required to run the code
refreshSchedules RefreshSchedule List of refresh schedules that indicate when the next prediction operator version will be processed
KEY TYPE Description
refreshPolicyId str The unique identifier of the refresh policy
nextRunTime str The next run time of the refresh policy. If null, the policy is paused.
cron str A cron-style string that describes the when this refresh policy is to be executed in UTC
refreshType str The type of refresh that will be run
error str An error message for the last pipeline run of a policy

Exceptions:

TYPE WHEN
DataNotFoundError

projectId is not found.

DataNotFoundError

featureGroupIds is not found.

Language: