Skip to content

abstract_type

Abstract feature type interface.

Type Aliases:

Name Description
ApiClientFeatureType

Classes:

Name Description
FeatureType

Abstract class representing a feature type.

ApiClientFeatureType = BBoxFeatureType | CategoricalFeatureType | ImageFeatureType | ListFeatureTypeInput | NumericalFeatureType | TimeseriesFeatureTypeInput | VectorFeatureTypeInput | HistogramFeatureType | OrdinalFeatureType #

FeatureType #

Abstract class representing a feature type.

Methods:

Name Description
to_model

Convert to an Api client feature type.

stable_hash

Return the feature type hash based on its database model.

from_model

Instantiate from a json response.

Attributes:

Name Type Description
name str

name: str = '' #

to_model() -> ApiClientFeatureType #

Convert to an Api client feature type.

Source code in src/xpdeep/dataset/feature/feature_types/abstract_type.py
def to_model(self) -> ApiClientFeatureType:
    """Convert to an Api client feature type."""
    raise NotImplementedError

stable_hash() -> str #

Return the feature type hash based on its database model.

Source code in src/xpdeep/dataset/feature/feature_types/abstract_type.py
def stable_hash(self) -> str:
    """Return the feature type hash based on its database model."""
    return str(sha256(f"{self.to_model().to_dict()}".encode()).hexdigest())

from_model(feature_type_input: Any) -> FeatureType #

Instantiate from a json response.

Source code in src/xpdeep/dataset/feature/feature_types/abstract_type.py
@staticmethod
def from_model(feature_type_input: Any) -> FeatureType:  # type:ignore[explicit-any]  # noqa:ANN401
    """Instantiate from a json response."""
    raise NotImplementedError