It is also worth noting that you can trigger a monitoring run whenever you want (e.g., after adding 1000 observations) by calling the trigger method from the Run. The previous three steps allow you to monitor an ML on the analysis data previously set. But once new production data is available, you might want to know how your model is performing on it. class.
You can load any previously set model by searching for it by name. Then, it's a matter of loading the new model predictions, adding them to the model using the method add_analysis_data, and triggering a new monitoring run.
# Find the previous model in NannyML Cloud by namemodel,= nml_sdk.monitoring.Model.list(name='Example model')# Add new inferences to NannyML Cloudnew_inferences = pd.DataFrame()nml_sdk.monitoring.Model.add_analysis_data(model['id'], new_inferences)# Trigger analysis of the new datanml_sdk.monitoring.Run.trigger(model['id'])
new_inferences can be a dataset with several new model inferences:
or even a single observation:
It is also worth noting that you can trigger a monitoring run whenever you want (e.g., after adding 1000 observations) by calling the trigger method from the Run class.