Customizing the monitoring model settings

Now we've created the monitoring model, we can start tweaking its settings before running it.

To do so, we'll fetch the RuntimeConfiguration linked to the monitoring model. It offers methods to easily fetch and modify the configuration entries.

# Fetch the correct RuntimeConfiguration
config = sdk.monitoring.RuntimeConfiguration.get(model_id=model["id"])

# Now we can use this object to manipulate the monitoring model settings.
# Let's enable the Jensen-Shannon Univariate Covariate Shift method for our target values.
config.univariate_drift_method("JENSEN_SHANNON").enable_targets()

# Let's disable the Domain Classifier Multivariate Covariate Shift method
config.multivariate_drift_method("DOMAIN_CLASSIFIER_AUROC").disable()

# Let's set a constant threshold for the Missing Values data quality metric
config.data_quality_metric("MISSING_VALUES").set_threshold(threshold_type="CONSTANT", upper=5)

# Now apply the altered configuration
sdk.monitoring.RuntimeConfiguration.set(model_id=model["id"], config=config)