feature
Represent a feature object.
Classes:
Name | Description |
---|---|
BaseFeature |
Base Feature used if no convenient available feature. |
NumericalFeature |
Numerical feature. |
CategoricalFeature |
Categorical feature. |
MultivariateNumericalFeature |
MultivariateNumericalFeature feature. |
UnivariateTimeSeries |
UnivariateTimeSerie feature. |
MultivariateTimeSeries |
MultivariateTimeSeries feature. |
ImageFeature |
Image feature. |
Attributes:
Name | Type | Description |
---|---|---|
ExposedFeature |
|
|
Feature |
|
__all__ = ['BaseFeature', 'CategoricalFeature', 'ExposedFeature', 'ExposedIndexMetadata', 'Feature', 'ImageFeature', 'MultivariateNumericalFeature', 'MultivariateTimeSeries', 'NumericalFeature', 'UnivariateTimeSeries']
#
ExposedFeature = ExposedCategoricalFeature | ExposedCategoricalFeatureList | ExposedNumericalFeature | ExposedMultivariateNumericalFeature | ExposedMultivariateTimeSeries | ExposedUnivariateTimeSeries | ExposedImage
#
EXPOSED_FEATURE_TYPE = TypeVar('EXPOSED_FEATURE_TYPE', bound=ExposedFeature)
#
FEATURE_AUGMENTATION_TYPE = TypeVar('FEATURE_AUGMENTATION_TYPE')
#
Feature = ImageFeature | NumericalFeature | CategoricalFeature | MultivariateNumericalFeature | UnivariateTimeSeries | MultivariateTimeSeries
#
AbstractDataElement
#
TargetableFeature
#
BaseFeature
#
Base Feature used if no convenient available feature.
Methods:
Name | Description |
---|---|
from_exposed |
BaseFeature from ExposedBaseFeature. |
as_exposed |
BaseFeature as ExposedBaseFeature. |
from_exposed(exposed_feature: ExposedBaseFeature) -> Self
#
ExplainableFeature
#
Define a feature object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
TorchPreprocessor | SklearnPreprocessor | IdentityPreprocessor
|
The feature preprocessor function used to preprocess the data. |
required |
|
ImageFeatureAugmentation | None
|
Feature augmentation functions, currently supported: ImageFeatureAugmentation. |
None
|
Methods:
Name | Description |
---|---|
as_exposed |
Feature as exposed feature. |
from_exposed |
Feature from exposed feature. |
Attributes:
Name | Type | Description |
---|---|---|
preprocessor |
TorchPreprocessor | SklearnPreprocessor | IdentityPreprocessor
|
|
feature_augmentation |
ImageFeatureAugmentation | None
|
|
preprocessor: TorchPreprocessor | SklearnPreprocessor | IdentityPreprocessor = field(kw_only=True)
#
feature_augmentation: ImageFeatureAugmentation | None = field(kw_only=True, default=None)
#
as_exposed(*, with_augmentation: bool) -> EXPOSED_FEATURE_TYPE | ExposedFeatureWithAugmentation
#
from_exposed(exposed_feature: EXPOSED_FEATURE_TYPE) -> Self
#
NumericalFeature
#
Numerical feature.
It represents quantifiable values that can be measured and ordered. Its values may be continuous (e.g., real numbers) or discrete (e.g., integers). For instance, "age" or "price" could be set as numerical features.
Methods:
Name | Description |
---|---|
from_exposed |
NumericalFeature from ExposedNumericalFeature. |
as_exposed |
NumericalFeature as ExposedNumericalFeature or ExposedFeatureWithAugmentation. |
from_exposed(exposed_feature: ExposedNumericalFeature) -> Self
#
NumericalFeature from ExposedNumericalFeature.
as_exposed(*, with_augmentation: bool = False) -> ExposedNumericalFeature | ExposedFeatureWithAugmentation
#
NumericalFeature as ExposedNumericalFeature or ExposedFeatureWithAugmentation.
Source code in src/xpdeep/dataset/schema/feature/feature.py
CategoricalFeature
#
Categorical feature.
It represents data (bool, int or str only) that can be divided into distinct groups or categories.
It may be nominal or ordinal. For instance, "Education level" or "gender" could be set as categorical features.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
list[str | int | bool]
|
Categories, automatically inferred from the preprocessor after the fitting step. None if not inferred yet. |
None
|
Methods:
Name | Description |
---|---|
from_exposed |
CategoricalFeature from ExposedCategoricalFeature. |
as_exposed |
ExposedCategoricalFeature as ExposedNumericalFeature or ExposedFeatureWithAugmentation. |
Attributes:
Name | Type | Description |
---|---|---|
categories |
list[str | int | bool]
|
|
categories: list[str | int | bool] = field(default=None, kw_only=True)
#
from_exposed(exposed_feature: ExposedCategoricalFeature) -> Self
#
CategoricalFeature from ExposedCategoricalFeature.
as_exposed(*, with_augmentation: bool = False) -> ExposedCategoricalFeature | ExposedFeatureWithAugmentation
#
ExposedCategoricalFeature as ExposedNumericalFeature or ExposedFeatureWithAugmentation.
Source code in src/xpdeep/dataset/schema/feature/feature.py
MultivariateNumericalFeature
#
MultivariateNumericalFeature feature.
It represents numerical data points divided into several channels. Oppositely as time serie features, there is no time relationship between points here.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
List[str] | None
|
List of channel names, optional. |
None
|
Methods:
Name | Description |
---|---|
from_exposed |
MultivariateNumericalFeature from ExposedMultivariateNumericalFeature. |
as_exposed |
MultivariateNumericalFeature as ExposedMultivariateNumericalFeature or ExposedFeatureWithAugmentation. |
Attributes:
Name | Type | Description |
---|---|---|
channel_names |
list[str] | None
|
|
channel_names: list[str] | None = field(default=None, kw_only=True)
#
from_exposed(exposed_feature: ExposedMultivariateNumericalFeature) -> Self
#
MultivariateNumericalFeature from ExposedMultivariateNumericalFeature.
Source code in src/xpdeep/dataset/schema/feature/feature.py
as_exposed(*, with_augmentation: bool = False) -> ExposedMultivariateNumericalFeature | ExposedFeatureWithAugmentation
#
MultivariateNumericalFeature as ExposedMultivariateNumericalFeature or ExposedFeatureWithAugmentation.
Source code in src/xpdeep/dataset/schema/feature/feature.py
UnivariateTimeSeries
#
UnivariateTimeSerie feature.
It represents a time serie with a single channel, synchronized (no dynamic time warping required) or not.
The DTW will be applied automatically if this feature is required.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
int
|
Whether the time serie is asynchronous (dynamic time warping will be automatically applied server side) or not. |
False.
|
|
str | None
|
Used in XpViz. Indeed, if the same channel is used for both input (as a lookback, under a first feature object) and target (as a horizon to predict, under a second feature object), this parameter may be specified to visualize on the same curve both features, (the lookback and its corresponding horizon). |
None
|
Methods:
Name | Description |
---|---|
from_exposed |
UnivariateTimeSeries from ExposedUnivariateTimeSeries. |
as_exposed |
UnivariateTimeSeries as ExposedUnivariateTimeSeries or ExposedFeatureWithAugmentation. |
Attributes:
Name | Type | Description |
---|---|---|
asynchronous |
bool
|
|
mirrored_channel |
str | None
|
|
asynchronous: bool = field(default=False, kw_only=True)
#
mirrored_channel: str | None = field(default=None, kw_only=True)
#
from_exposed(exposed_feature: ExposedUnivariateTimeSeries) -> Self
#
UnivariateTimeSeries from ExposedUnivariateTimeSeries.
as_exposed(*, with_augmentation: bool = False) -> ExposedUnivariateTimeSeries | ExposedFeatureWithAugmentation
#
UnivariateTimeSeries as ExposedUnivariateTimeSeries or ExposedFeatureWithAugmentation.
Source code in src/xpdeep/dataset/schema/feature/feature.py
MultivariateTimeSeries
#
MultivariateTimeSeries feature.
This class represents a multivariate time series (multiple channels), synchronized (no dynamic time warping required) or not.
The DTW will be applied automatically if this feature is required.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
int
|
Whether the time serie is asynchronous (dynamic time warping will be automatically applied server side) or not. |
False.
|
|
List[str] | None
|
List of channel names, optional. |
None
|
Methods:
Name | Description |
---|---|
from_exposed |
ExposedMultivariateTimeSeries from ExposedMultivariateTimeSeries. |
as_exposed |
MultivariateTimeSeries as ExposedMultivariateTimeSeries or ExposedFeatureWithAugmentation. |
Attributes:
Name | Type | Description |
---|---|---|
asynchronous |
bool
|
|
channel_names |
list[str] | None
|
|
asynchronous: bool = field(default=False, kw_only=True)
#
channel_names: list[str] | None = field(default=None, kw_only=True)
#
from_exposed(exposed_feature: ExposedMultivariateTimeSeries) -> Self
#
ExposedMultivariateTimeSeries from ExposedMultivariateTimeSeries.
as_exposed(*, with_augmentation: bool = False) -> ExposedMultivariateTimeSeries | ExposedFeatureWithAugmentation
#
MultivariateTimeSeries as ExposedMultivariateTimeSeries or ExposedFeatureWithAugmentation.
Source code in src/xpdeep/dataset/schema/feature/feature.py
ImageFeature
#
Image feature.
It represents image feature objects.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
int | None
|
|
None
|
|
int | None
|
|
None
|
|
str
|
|
'PNG'
|
Methods:
Name | Description |
---|---|
from_exposed |
NumericalFeature from ExposedImage. |
as_exposed |
NumericalFeature as ExposedImage or ExposedFeatureWithAugmentation. |
Attributes:
Name | Type | Description |
---|---|---|
serialized_width |
int | None
|
|
serialized_height |
int | None
|
|
serialized_byte_format |
str
|
|
serialized_width: int | None = None
#
serialized_height: int | None = None
#
serialized_byte_format: str = 'PNG'
#
from_exposed(exposed_feature: ExposedImage) -> Self
#
as_exposed(*, with_augmentation: bool = False) -> ExposedImage | ExposedFeatureWithAugmentation
#
NumericalFeature as ExposedImage or ExposedFeatureWithAugmentation.
Source code in src/xpdeep/dataset/schema/feature/feature.py
IndexMetadata
#
Represents an index metadata, automatically added to the schema, cf doc dataset/concept.
Methods:
Name | Description |
---|---|
as_exposed |
Generate the corresponding exposed ExposedIndexMetadata. |
from_exposed |
Create IndexMetadata from ExposedIndexMetadata. |