Dealing with a MissingMetadataException

The problem

Running the fit, calculate or estimate methods of a Calculator or Estimator fails by returning a MissingMetadataException.

nannyml.exceptions.MissingMetadataException: metadata is still missing values for ['predicted_probability_column_name'].

The solution

The MissingMetadataException is raised when the model metadata used to create the Calculator or Estimator is not complete, i.e. it is missing some required properties.

The exception will list the properties it is missing, as shown in the problem statement. You can fix this by specifying the column of data which should be attributed to the missing metadata.

For example, assume md is the model metadata object used, predicted_probability_column_name is the property missing, and in your data the predicted probabilities are located in the model_probas column.

The following snippet completes the metadata manually, preventing the exception from occuring:

>>> md.is_complete()  # just checking
(False, ['predicted_probability_column_name'])
>>> md.predicted_probability_column_name = 'model_probas'
>>> md.is_complete()
(True, [])

Any metadata property can be set or updated in this way.