snowflake.ml.model.model_signature.ModelSignature¶
- class snowflake.ml.model.model_signature.ModelSignature(inputs: Sequence[BaseFeatureSpec], outputs: Sequence[BaseFeatureSpec], params: Optional[Sequence[BaseParamSpec]] = None)¶
Bases:
objectSignature of a model that specifies the input and output of a model.
Initialize a model signature.
- Parameters:
inputs – A sequence of feature specifications and feature group specifications that will compose the input of the model.
outputs – A sequence of feature specifications and feature group specifications that will compose the output of the model.
params – A sequence of parameter specifications and parameter group specifications that will compose the parameters of the model. Defaults to None.
- Raises:
SnowflakeMLException – ValueError: When the parameters have duplicate names or the same names as input features.
Methods
- classmethod from_dict(loaded: dict[str, Any]) ModelSignature¶
Create a signature given the dict containing specifications of children features and feature groups.
- Parameters:
loaded – The dict to be deserialized.
- Returns:
A signature deserialized and created from the dict.
- classmethod from_mlflow_sig(mlflow_sig: mlflow.models.ModelSignature) ModelSignature¶
- to_dict() dict[str, Any]¶
Generate a dict to represent the whole signature.
- Returns:
A dict that serializes the signature.
Attributes
- inputs¶
Inputs of the model, containing a sequence of feature specifications and feature group specifications.
- outputs¶
Outputs of the model, containing a sequence of feature specifications and feature group specifications.
- params¶
Parameters of the model, containing a sequence of parameter specifications.