Capture prediction data
To add the DominoDataCapture library details to your model, you must add the following lines so that this logic is executed when the model is deployed. See call a Domino endpoint for details.- In the top navigation pane, click Develop > Projects.
- In the navigation pane of your project, click Workspaces.
- Start the appropriate workspace.
- Edit your prediction code: Edit your prediction code to add the DataCaptureClient. See the following examples for Python and R:
DataCaptureClient statement:
The following table explains the parameters from the
capturePrediction statement:
Run DataCaptureClient
Use theDominoDataCapture library to capture prediction data in the Domino endpoint or in developer mode. Use developer mode to test the library calls to verify that the data capture works, without actually capturing data. After verifying that the data capture works, you must invoke the Domino endpoint code in a workspace (for example, an iPython notebook), where you can review the output of the library calls, validate, and debug the code.
Domino endpoints support capturing up to 8 GB of data per 24-hour period. Bursting has been tested up to five times this limit, beyond which there might be errors or warnings in the Domino endpoint log.
- Run an example in Python
- Run an example in R
- Open a Python Prediction Client workspace.
- Go to New > Python3.
-
Add the following lines and update them for your model:
-
Import the predict function:
from python_model_with_logging import * -
Invoke the predict method with parameters:
predict_iris_variety(5.3,3,1.1,0.1, 1)
-
Import the predict function:
Data capture examples
See more examples of MLflow-supported models that use Domino data capture:- Registering XGBoost model with integrated model monitoring.
- Registering Sklearn model with integrated model monitoring.
(Optional) customize Domino environments
If you want to use a specific version of the client library, or enable client libraries in another environment:- In your Environment, click Edit Definition.
-
In the Dockerfile Instructions, add the following lines to enable the library:
- Select Full rebuild without cache and click Build.
- From the navigation bar, click Endpoints.
- Click New endpoint and create the endpoint from the newly built image.
Test the Domino endpoint
See Validate your Setup to confirm your prediction data is being captured. After you publish your Domino endpoint and it is running, call the Domino endpoint to capture prediction data.- Go to the Domino endpoint to test.
- From the Tester tab, enter the values from your model’s schema.
- Click Send. The Response field shows a prediction in the form of key-value pair.