feature_types
Feature types module.
Classes:
Name | Description |
---|---|
NumericalFeature |
Numerical feature. |
CategoricalFeature |
Categorical feature. |
MultivariateNumericalFeature |
MultivariateNumericalFeature feature. |
UnivariateTimeSeries |
UnivariateTimeSerie feature. |
MultivariateTimeSeries |
MultivariateTimeSeries feature. |
ImageFeature |
Image feature. |
FeatureTypeConvertor |
Class for converting exposed features type into feature types. |
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.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
Literal[str]
|
|
'numerical'
|
Methods:
Name | Description |
---|---|
from_exposed |
Instantiate a NumericalFeature from ExposedNumerical. |
Attributes:
Name | Type | Description |
---|---|---|
name |
Literal['numerical']
|
|
as_exposed |
ExposedNumerical
|
NumericalFeature as ExposedNumericalFeature or ExposedFeatureWithAugmentation. |
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
|
|
Literal[str]
|
|
'categorical'
|
Methods:
Name | Description |
---|---|
from_exposed |
Instantiate a CategoricalFeature from ExposedCategorical. |
Attributes:
Name | Type | Description |
---|---|---|
name |
Literal['categorical']
|
|
categories |
list[str | int | bool] | None
|
|
as_exposed |
ExposedCategorical
|
As ExposedCategorical. |
name: Literal['categorical'] = 'categorical'
#
categories: list[str | int | bool] | None = field(default=None, kw_only=True)
#
as_exposed: ExposedCategorical
#
As ExposedCategorical.
from_exposed(exposed_feature: ExposedCategorical) -> CategoricalFeature
#
Instantiate a CategoricalFeature from ExposedCategorical.
Source code in src/xpdeep/dataset/feature/feature_types.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
|
|
Literal[str]
|
|
'multivariate_numerical'
|
Methods:
Name | Description |
---|---|
from_exposed |
Instantiate a MultivariateNumericalFeature from an ExposedVectorNumerical. |
Attributes:
Name | Type | Description |
---|---|---|
name |
Literal['multivariate_numerical']
|
|
channel_names |
list[str] | None
|
|
as_exposed |
ExposedVectorNumerical
|
As ExposedVectorNumerical. |
name: Literal['multivariate_numerical'] = 'multivariate_numerical'
#
channel_names: list[str] | None = field(default=None, kw_only=True)
#
as_exposed: ExposedVectorNumerical
#
As ExposedVectorNumerical.
from_exposed(exposed_feature: ExposedVectorNumerical) -> MultivariateNumericalFeature
#
Instantiate a MultivariateNumericalFeature from an ExposedVectorNumerical.
Source code in src/xpdeep/dataset/feature/feature_types.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
|
|
Literal[str]
|
|
'univariate_time_series'
|
Methods:
Name | Description |
---|---|
from_exposed |
Instantiate a UnivariateTimeSeries from an ExposedUnivariateTimeSeries. |
Attributes:
Name | Type | Description |
---|---|---|
name |
Literal['univariate_time_series']
|
|
asynchronous |
bool
|
|
mirrored_channel |
str | None
|
|
as_exposed |
ExposedUnivariateTimeSeries
|
As ExposedUnivariateTimeSeries. |
name: Literal['univariate_time_series'] = 'univariate_time_series'
#
asynchronous: bool = field(default=False, kw_only=True)
#
mirrored_channel: str | None = field(default=None, kw_only=True)
#
as_exposed: ExposedUnivariateTimeSeries
#
As ExposedUnivariateTimeSeries.
from_exposed(exposed_feature: ExposedUnivariateTimeSeries) -> UnivariateTimeSeries
#
Instantiate a UnivariateTimeSeries from an ExposedUnivariateTimeSeries.
Source code in src/xpdeep/dataset/feature/feature_types.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
|
|
Literal[str]
|
|
'multivariate_time_series'
|
Methods:
Name | Description |
---|---|
from_exposed |
Instantiate a MultivariateTimeSeries from a ExposedMultivariateTimeSeries. |
Attributes:
Name | Type | Description |
---|---|---|
name |
Literal['multivariate_time_series']
|
|
asynchronous |
bool
|
|
channel_names |
list[str] | None
|
|
as_exposed |
ExposedMultivariateTimeSeries
|
As ExposedMultivariateTimeSeries. |
name: Literal['multivariate_time_series'] = 'multivariate_time_series'
#
asynchronous: bool = field(default=False, kw_only=True)
#
channel_names: list[str] | None = field(default=None, kw_only=True)
#
as_exposed: ExposedMultivariateTimeSeries
#
As ExposedMultivariateTimeSeries.
from_exposed(exposed_feature: ExposedMultivariateTimeSeries) -> MultivariateTimeSeries
#
Instantiate a MultivariateTimeSeries from a ExposedMultivariateTimeSeries.
Source code in src/xpdeep/dataset/feature/feature_types.py
ImageFeature
#
Image feature.
It represents image feature objects.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
Literal[str]
|
|
'image'
|
|
int | None
|
|
None
|
|
int | None
|
|
None
|
|
str
|
|
'PNG'
|
Methods:
Name | Description |
---|---|
from_exposed |
Instantiate an ImageFeature from an ExposedImage. |
Attributes:
Name | Type | Description |
---|---|---|
name |
Literal['image']
|
|
serialized_width |
int | None
|
|
serialized_height |
int | None
|
|
serialized_byte_format |
str
|
|
as_exposed |
ExposedImage
|
As ExposedImage. |
name: Literal['image'] = 'image'
#
serialized_width: int | None = None
#
serialized_height: int | None = None
#
serialized_byte_format: str = 'PNG'
#
as_exposed: ExposedImage
#
As ExposedImage.
from_exposed(exposed_feature: ExposedImage) -> ImageFeature
#
Instantiate an ImageFeature from an ExposedImage.
Source code in src/xpdeep/dataset/feature/feature_types.py
FeatureTypeConvertor
#
Class for converting exposed features type into feature types.
For instance, it recognizes an ExposedNumerical and instantiate corresponding NumericalFeature.
Methods:
Name | Description |
---|---|
from_exposed |
Convert exposed feature type into feature type. |
from_exposed(exposed_feature_type: ExposedNumerical | ExposedVectorNumerical | ExposedCategorical | ExposedUnivariateTimeSeries | ExposedMultivariateTimeSeries | ExposedImage) -> NumericalFeature | MultivariateNumericalFeature | CategoricalFeature | UnivariateTimeSeries | MultivariateTimeSeries | ImageFeature
#
Convert exposed feature type into feature type.