Skip to content

feature

The features module provides a list of feature object to be used to define the dataset structure.

Modules:

Name Description
abstracts

Feature abstract classes module.

augmentation

feature's utils.

feature

Represent a feature object.

feature_types

Feature types module.

Classes:

Name Description
BaseFeature

Base Feature used if no convenient available feature.

ExplainableFeature

Define a feature object.

IndexMetadata

Represents an index metadata, automatically added to the schema, cf doc dataset/concept.

BaseFeature #

Base Feature used if no convenient available feature.

Parameters:

Name Type Description Default

name #

str
required

id #

str | None
None

is_target #

bool
False

ExplainableFeature #

Define a feature object.

Parameters:

Name Type Description Default

id #

UUID | None

Feature Identifier

None

is_target #

bool

Whether the feature is target or not.

False

feature_type #

ImageFeature | NumericalFeature | CategoricalFeature | MultivariateTimeSeriesFeature | UnivariateTimeSeriesFeature | MultivariateNumericalFeature | BoundingBoxesFeature
required

UnivariateTimeSeriesFeature #

Feature type.

required

preprocessor #

TorchPreprocessor | SklearnPreprocessor | IdentityPreprocessor

The feature preprocessor function used to preprocess the data.

required

name #

str
required

feature_augmentation #

ImageFeatureAugmentation | None
None

Methods:

Name Description
to_model

Convert to FeatureInsert instance.

Attributes:

Name Type Description
feature_type ImageFeature | NumericalFeature | CategoricalFeature | MultivariateTimeSeriesFeature | UnivariateTimeSeriesFeature | MultivariateNumericalFeature | BoundingBoxesFeature
preprocessor TorchPreprocessor | SklearnPreprocessor | IdentityPreprocessor | BoundingBoxesPreprocessor
feature_augmentation ImageFeatureAugmentation | None

feature_type: ImageFeature | NumericalFeature | CategoricalFeature | MultivariateTimeSeriesFeature | UnivariateTimeSeriesFeature | MultivariateNumericalFeature | BoundingBoxesFeature = field(kw_only=True) #

preprocessor: TorchPreprocessor | SklearnPreprocessor | IdentityPreprocessor | BoundingBoxesPreprocessor = field(kw_only=True) #

feature_augmentation: ImageFeatureAugmentation | None = field(kw_only=True, default=None) #

to_model() -> FeatureInsert #

Convert to FeatureInsert instance.

Source code in src/xpdeep/dataset/feature/feature.py
def to_model(self) -> FeatureInsert:
    """Convert to FeatureInsert instance."""
    return FeatureInsert(
        type_="FEATURE",
        name=self.name,
        feature_type=self.feature_type.to_model(),
        is_target=self.is_target,
        preprocessor=self.preprocessor.to_model(),
        augmentation=self.feature_augmentation.to_model() if self.feature_augmentation is not None else None,
    )

IndexMetadata #

Represents an index metadata, automatically added to the schema, cf doc dataset/concept.

Parameters:

Name Type Description Default

name #

str
required

id #

str | None
None

feature_type #

str
'xpdeep_index'

Methods:

Name Description
to_model

Convert to IndexMetadataInsert instance.

Attributes:

Name Type Description
name str
id str | None
feature_type str

name: str #

id: str | None = None #

feature_type: str = 'xpdeep_index' #

to_model() -> IndexMetadataInsert #

Convert to IndexMetadataInsert instance.

Source code in src/xpdeep/dataset/feature/feature.py
def to_model(self) -> IndexMetadataInsert:
    """Convert to IndexMetadataInsert instance."""
    return IndexMetadataInsert(name=self.name, type_="INDEX_METADATA")