snowflake.ml.model.model_signature.BaseFeatureSpec

class snowflake.ml.model.model_signature.BaseFeatureSpec(name: str, shape: tuple[int, ...] | None)

Bases: ABC

Abstract Class for specification of a feature.

Methods

abstract as_dtype(force_numpy_dtype: bool = False) type[Any] | dtype[Any] | _SupportsDType[dtype[Any]] | tuple[Any, Any] | list[Any] | _DTypeDict | str | None | Int8Dtype | Int16Dtype | Int32Dtype | Int64Dtype | UInt8Dtype | UInt16Dtype | UInt32Dtype | UInt64Dtype | Float32Dtype | Float64Dtype | BooleanDtype | StringDtype

Convert to corresponding local Type.

abstract as_snowpark_type() DataType

Convert to corresponding Snowpark Type.

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

Deserialization

abstract to_dict() dict[str, Any]

Serialization

Attributes

name

Name of the feature.