Skip to content

Code-based

The code-based monitor allows running a custom monitoring logic implemented using python code.

The monitoring code is a function that gets two pandas.Series of raw data called baseline and current, and allows you to implement your custom business monitoring logic using them.

Detection Methods

  • Compared overtime - Passes baseline and current data based on the timeframe you decide.
  • Compared To Segment - Passes baseline and current data based on timeframe and segmentations of the data that you decide to use.

Configuration

Compared overtime

Code-based, Compared overtime configuration

  1. Select the Inspect the last field. The current data will be based on this timeframe.
  2. Select the Compared to field. The baseline data will be based on this timeframe.
  3. Select a field type in the Inspect box.
  4. Select the fields you want to monitor to run on.
  5. Implement your monitoring logic.

Compared to segment

Code-based, Compared to segment configuration

  1. Select a data segment and a data segment value in the Subject box. The current data will be based on this segmentation.
  2. Select a field type in the Inspect box.
  3. Select the fields you want to monitor to run on.
  4. Select a data segment and a data segment value in the Detection box. The baseline data will be based on this segmentation.
  5. Select an Inspection Period. The baseline and current data will be gathered out of this timeframe.
  6. You may select Minimum Prediction Count, which will run the monitor only if the number of the predictions in the current data (in the selected timeframe and after segmentation) is higher than the number you chose.
  7. Implement your monitoring logic.

Notes

  • We created a notebook playground for you that provides sample numerical and categorical baseline and current data so that you'll be able to play and test with your code.
  • The code-based monitor is not supported currently in the REST API.