ML Model Abstract Base Class¶
-
class
ml_model_abc.
MLModel
¶ An abstract base class for ML model prediction code
-
__init__
()¶ This method holds any deserialization and initialization code for the model.
-
description
¶ This abstract property returns a description of the model.
-
display_name
¶ This abstract property returns a display name for the model.
Note
This is a name for the model that looks good in user interfaces.
-
input_schema
¶ This abstract property returns the schema that is accepted by the predict() method.
-
major_version
¶ This abstract property returns the model’s major version as a string.
-
minor_version
¶ This abstract property returns the model’s minor version as a string.
-
output_schema
¶ This abstract property returns the schema that is returned by the predict() method.
-
predict
(data)¶ Method to make a prediction with the model.
- Parameters
data (object -- can be any python type) – data used by the model for making a prediction
- Return type
python object – can be any python type
-
qualified_name
¶ This abstract property returns the qualified name of the model.
Note
A qualified name is an unambiguous identifier for the model. It should be possible to embed it in an URL.
-
-
class
ml_model_abc.
MLModelException
(*args)¶ Exception type used to raise exceptions within MLModel derived classes
-
class
ml_model_abc.
MLModelSchemaValidationException
(*args)¶ Exception type used to raise schema validation exceptions within MLModel derived classes