informatics-lab / precip_rediagnosis

Project to use ML to re-diagnose precipitation fields from ensemble model fields
0 stars 0 forks source link

Define Model signature for ML Flow #98

Open stevehadd opened 1 year ago

stevehadd commented 1 year ago

For registering our models in MLFlow (and probably other frameworks) we should define the schema for the model(s). This involves describing the following aspects:

Defiining https://www.mlflow.org/docs/latest/models.html#model-signature

The key code is as follows:

signature = mlflow.models.signature.infer_signature(testX, model.predict(testX))
mlflow.keras.log_model(model, "mnist_cnn", signature=signature)

It is not clear how this works with the autolog functionality.

stevehadd commented 1 year ago

this would be useful for a robist inference pipeline so we can save the trained models and easily use the mlflow for loading in the model and matching the data to essure we are doing inference correcftly for our testbed dashboard