Skip to content

feature

Represent a feature object.

__all__ = ['BaseFeature', 'CategoricalFeature', 'ExposedFeature', 'Feature', 'Image', 'Metadata', 'MultivariateAsynchronousTimeSerie', 'MultivariateNumericalFeature', 'MultivariateSynchronousTimeSerie', 'NumericalFeature', 'Token', 'UnivariateAsynchronousTimeSerie', 'UnivariateSynchronousTimeSerie', 'YoloBboxWithClassFeature'] #

ExposedFeature = ExposedCategoricalFeature | ExposedCategoricalFeatureList | ExposedNumericalFeature | ExposedMultivariateNumericalFeature | ExposedBboxFeatureList | ExposedUnivariateSynchronousTimeSerie | ExposedUnivariateAsynchronousTimeSerie | ExposedMultivariateSynchronousTimeSerie | ExposedMultivariateAsynchronousTimeSerie | ExposedImage | ExposedToken | ExposedYoloBboxWithClassFeature | ExposedMetadata #

EXPOSED_FEATURE_TYPE = TypeVar('EXPOSED_FEATURE_TYPE', bound=ExposedFeature) #

Feature = NumericalFeature | CategoricalFeature | MultivariateNumericalFeature | UnivariateSynchronousTimeSerie | UnivariateAsynchronousTimeSerie | MultivariateSynchronousTimeSerie | MultivariateAsynchronousTimeSerie | Image | Token | YoloBboxWithClassFeature | Metadata #

AbstractDataElement #

Represent a schema column, with a name.

Parameters:

Name Type Description Default
name str
required

name: str #

TargetableFeature #

A feature that can be a target.

Parameters:

Name Type Description Default
is_target bool
False

is_target: bool = False #

BaseFeature #

Base Feature used if no convenient available feature.

as_exposed: ExposedBaseFeature #

NumericalFeature as ExposedNumericalFeature.

from_exposed(exposed_feature: ExposedBaseFeature) -> Self #

BaseFeature from ExposedBaseFeature.

Source code in src/xpdeep/dataset/schema/feature/feature.py
@classmethod
def from_exposed(cls, exposed_feature: ExposedBaseFeature) -> Self:
    """BaseFeature from ExposedBaseFeature."""
    return cls(**msgspec_asdict(exposed_feature))

ExplainableFeature #

Define a feature object.

Parameters:

Name Type Description Default
preprocessor SklearnPreprocessor | IdentityPreprocessor

feature preprocessor function used to preprocess the data.

required

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

as_exposed: EXPOSED_FEATURE_TYPE #

Feature as exposed feature.

from_exposed(exposed_feature: EXPOSED_FEATURE_TYPE) -> Self #

Feature from exposed feature.

Source code in src/xpdeep/dataset/schema/feature/feature.py
@classmethod
def from_exposed(cls, exposed_feature: EXPOSED_FEATURE_TYPE) -> Self:
    """Feature from exposed feature."""
    raise NotImplementedError

NumericalFeature #

Numerical feature.

as_exposed: ExposedNumericalFeature #

NumericalFeature as ExposedNumericalFeature.

from_exposed(exposed_feature: ExposedNumericalFeature) -> Self #

NumericalFeature from ExposedNumericalFeature.

Source code in src/xpdeep/dataset/schema/feature/feature.py
@classmethod
def from_exposed(cls, exposed_feature: ExposedNumericalFeature) -> Self:
    """NumericalFeature from ExposedNumericalFeature."""
    return cast(Self, cls._from_exposed(exposed_feature))

CategoricalFeature #

Categorical feature.

Parameters:

Name Type Description Default
categories list[Union[str, int, bool]]
required

categories: list[str | int | bool] = field(kw_only=True) #

as_exposed: ExposedCategoricalFeature #

CategoricalFeature as ExposedCategoricalFeature.

from_exposed(exposed_feature: ExposedCategoricalFeature) -> Self #

CategoricalFeature from ExposedCategoricalFeature.

Source code in src/xpdeep/dataset/schema/feature/feature.py
@classmethod
def from_exposed(cls, exposed_feature: ExposedCategoricalFeature) -> Self:
    """CategoricalFeature from ExposedCategoricalFeature."""
    return cast(Self, cls._from_exposed(exposed_feature))

MultivariateNumericalFeature #

MultivariateNumericalFeature feature.

Parameters:

Name Type Description Default
size int
required
channel_names list[str] | None
None

size: int = field(kw_only=True) #

channel_names: list[str] | None = field(default=None, kw_only=True) #

as_exposed: ExposedMultivariateNumericalFeature #

MultivariateNumericalFeature as ExposedMultivariateNumericalFeature.

from_exposed(exposed_feature: ExposedMultivariateNumericalFeature) -> Self #

MultivariateNumericalFeature from ExposedMultivariateNumericalFeature.

Source code in src/xpdeep/dataset/schema/feature/feature.py
@classmethod
def from_exposed(cls, exposed_feature: ExposedMultivariateNumericalFeature) -> Self:
    """MultivariateNumericalFeature from ExposedMultivariateNumericalFeature."""
    return cast(Self, cls._from_exposed(exposed_feature))

UnivariateSynchronousTimeSerie #

UnivariateSynchronousTimeSerie feature.

Parameters:

Name Type Description Default
size int
required
mirrored_channel str | None
None

size: int = field(kw_only=True) #

mirrored_channel: str | None = field(default=None, kw_only=True) #

as_exposed: ExposedUnivariateSynchronousTimeSerie #

UnivariateSynchronousTimeSerie as ExposedUnivariateSynchronousTimeSerie.

from_exposed(exposed_feature: ExposedUnivariateSynchronousTimeSerie) -> Self #

UnivariateSynchronousTimeSerie from ExposedUnivariateSynchronousTimeSerie.

Source code in src/xpdeep/dataset/schema/feature/feature.py
@classmethod
def from_exposed(cls, exposed_feature: ExposedUnivariateSynchronousTimeSerie) -> Self:
    """UnivariateSynchronousTimeSerie from ExposedUnivariateSynchronousTimeSerie."""
    return cast(Self, cls._from_exposed(exposed_feature))

UnivariateAsynchronousTimeSerie #

UnivariateSynchronousTimeSerie feature.

Parameters:

Name Type Description Default
size int
required
mirrored_channel str | None
None

size: int = field(kw_only=True) #

mirrored_channel: str | None = field(default=None, kw_only=True) #

as_exposed: ExposedUnivariateAsynchronousTimeSerie #

UnivariateAsynchronousTimeSerie as ExposedUnivariateAsynchronousTimeSerie.

from_exposed(exposed_feature: ExposedUnivariateAsynchronousTimeSerie) -> Self #

UnivariateAsynchronousTimeSerie from ExposedUnivariateAsynchronousTimeSerie.

Source code in src/xpdeep/dataset/schema/feature/feature.py
@classmethod
def from_exposed(cls, exposed_feature: ExposedUnivariateAsynchronousTimeSerie) -> Self:
    """UnivariateAsynchronousTimeSerie from ExposedUnivariateAsynchronousTimeSerie."""
    return cast(Self, cls._from_exposed(exposed_feature))

MultivariateSynchronousTimeSerie #

MultivariateSynchronousTimeSerie feature.

Parameters:

Name Type Description Default
size list[int]
required
channel_names str | None
None

size: list[int] = field(kw_only=True) #

channel_names: str | None = field(default=None, kw_only=True) #

as_exposed: ExposedMultivariateSynchronousTimeSerie #

MultivariateSynchronousTimeSerie as ExposedMultivariateSynchronousTimeSerie.

from_exposed(exposed_feature: ExposedMultivariateSynchronousTimeSerie) -> Self #

MultivariateSynchronousTimeSerie from ExposedMultivariateSynchronousTimeSerie.

Source code in src/xpdeep/dataset/schema/feature/feature.py
@classmethod
def from_exposed(cls, exposed_feature: ExposedMultivariateSynchronousTimeSerie) -> Self:
    """MultivariateSynchronousTimeSerie from ExposedMultivariateSynchronousTimeSerie."""
    return cast(Self, cls._from_exposed(exposed_feature))

MultivariateAsynchronousTimeSerie #

MultivariateAsynchronousTimeSerie feature.

Parameters:

Name Type Description Default
size list[int]
required
channel_names list[str] | None
None

size: list[int] = field(kw_only=True) #

channel_names: list[str] | None = field(default=None, kw_only=True) #

as_exposed: ExposedMultivariateAsynchronousTimeSerie #

MultivariateAsynchronousTimeSerie as ExposedMultivariateAsynchronousTimeSerie.

from_exposed(exposed_feature: ExposedMultivariateAsynchronousTimeSerie) -> Self #

MultivariateAsynchronousTimeSerie from ExposedMultivariateAsynchronousTimeSerie.

Source code in src/xpdeep/dataset/schema/feature/feature.py
@classmethod
def from_exposed(cls, exposed_feature: ExposedMultivariateAsynchronousTimeSerie) -> Self:
    """MultivariateAsynchronousTimeSerie from ExposedMultivariateAsynchronousTimeSerie."""
    return cast(Self, cls._from_exposed(exposed_feature))

Image #

Image feature.

Parameters:

Name Type Description Default
size tuple[int, ...]
required

size: tuple[int, ...] = field(kw_only=True) #

as_exposed: ExposedImage #

Image as ExposedImage.

from_exposed(exposed_feature: ExposedImage) -> Self #

Image from ExposedImage.

Source code in src/xpdeep/dataset/schema/feature/feature.py
@classmethod
def from_exposed(cls, exposed_feature: ExposedImage) -> Self:
    """Image from ExposedImage."""
    return cast(Self, cls._from_exposed(exposed_feature))

Token #

Token feature.

as_exposed: ExposedToken #

Token as ExposedToken.

from_exposed(exposed_feature: ExposedToken) -> Self #

Token from ExposedToken.

Source code in src/xpdeep/dataset/schema/feature/feature.py
@classmethod
def from_exposed(cls, exposed_feature: ExposedToken) -> Self:
    """Token from ExposedToken."""
    return cast(Self, cls._from_exposed(exposed_feature))

YoloBboxWithClassFeature #

YoloBboxWithClassFeature feature.

as_exposed: ExposedYoloBboxWithClassFeature #

YoloBboxWithClassFeature as ExposedYoloBboxWithClassFeature.

from_exposed(exposed_feature: ExposedYoloBboxWithClassFeature) -> Self #

YoloBboxWithClassFeature from ExposedYoloBboxWithClassFeature.

Source code in src/xpdeep/dataset/schema/feature/feature.py
@classmethod
def from_exposed(cls, exposed_feature: ExposedYoloBboxWithClassFeature) -> Self:
    """YoloBboxWithClassFeature from ExposedYoloBboxWithClassFeature."""
    return cast(Self, cls._from_exposed(exposed_feature))

Metadata #

Metadata.

as_exposed: ExposedMetadata #

Generate the corresponding exposed feature.

from_exposed(exposed_metadata: ExposedMetadata) -> Self #

Create Metadata from exposed metadata.

Source code in src/xpdeep/dataset/schema/feature/feature.py
@classmethod
def from_exposed(cls, exposed_metadata: ExposedMetadata) -> Self:
    """Create Metadata from exposed metadata."""
    return cls(name=exposed_metadata.name)