snowflake.ml.model.model_signature.ParamGroupSpec

class snowflake.ml.model.model_signature.ParamGroupSpec(name: str, specs: list[snowflake.ml.model._signatures.core.BaseParamSpec], shape: Optional[tuple[int, ...]] = None)

Bases: BaseParamSpec

Specification of a group of parameters in Snowflake native model packaging.

Initialize a parameter group.

Parameters:
  • name – Name of the parameter group.

  • specs – A list of parameter specifications that composes the group.

  • shape – Shape of the parameter group. None means scalar, otherwise a tuple representing dimensions. Use -1 for variable length dimensions.

Methods

as_snowpark_type() DataType

Convert to corresponding Snowpark Type, accounting for shape.

Returns:

A Snowpark MapType representing an OBJECT in Snowflake. If shape is specified, wraps the base type in ArrayType.

classmethod from_dict(input_dict: dict[str, Any]) ParamGroupSpec

Deserialize the parameter group from a dict.

Parameters:

input_dict – The dict containing information of the parameter group.

Returns:

A parameter group instance deserialized and created from the dict.

to_dict() dict[str, Any]

Serialize the parameter group into a dict.

Returns:

A dict that serializes the parameter group.

Attributes

default_value

Default value of the parameter group.

Without shape: returns a dict mapping parameter names to their default values. With shape: returns a nested list structure where each leaf is the default dict. Variable-length dimensions (-1) result in empty arrays. Nested ParamGroupSpecs produce nested dicts (or arrays if they have shape).

Returns:

A dict or nested list of dicts depending on shape.

dtype

Type of the parameter group. Always OBJECT.

name

Name of the parameter.

shape

Shape of the parameter. None means scalar.

specs

List of parameter specifications in the group.