feature_types
Feature types module.
Classes:
| Name | Description |
|---|---|
NumericalFeature |
Numerical feature. |
CategoricalFeature |
Categorical feature. |
MultivariateNumericalFeature |
MultivariateNumericalFeature feature. |
UnivariateTimeSeriesFeature |
UnivariateTimeSerie feature. |
MultivariateTimeSeriesFeature |
MultivariateTimeSeries feature. |
Functions:
| Name | Description |
|---|---|
feature_type_from_model |
Convert json features into the corresponding Feature. |
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['NUMERICAL']
|
|
'NUMERICAL'
|
Methods:
| Name | Description |
|---|---|
to_model |
Convert to NumericalFeatureType instance. |
Attributes:
| Name | Type | Description |
|---|---|---|
name |
Literal['NUMERICAL']
|
|
name: Literal['NUMERICAL'] = 'NUMERICAL'
#
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] | list[int] | None
|
|
None
|
|
Literal['CATEGORICAL']
|
|
'CATEGORICAL'
|
Methods:
| Name | Description |
|---|---|
to_model |
Convert to CategoricalFeatureType instance. |
__attrs_post_init__ |
Return a fake category to be overwritten by the fitted preprocessor inferred categories. |
Attributes:
| Name | Type | Description |
|---|---|---|
name |
Literal['CATEGORICAL']
|
|
categories |
list[str] | list[int] | None
|
|
name: Literal['CATEGORICAL'] = 'CATEGORICAL'
#
categories: list[str] | list[int] | None = None
#
to_model() -> CategoricalFeatureType
#
Convert to CategoricalFeatureType instance.
Source code in src/xpdeep/dataset/feature/feature_types.py
__attrs_post_init__() -> None
#
Return a fake category to be overwritten by the fitted preprocessor inferred categories.
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]
|
List of channel names used for visualization. |
required |
|
Literal['MULTIVARIATE_NUMERICAL']
|
|
'MULTIVARIATE_NUMERICAL'
|
Methods:
| Name | Description |
|---|---|
to_model |
Convert to MultivariateNumericalFeatureType instance. |
Attributes:
| Name | Type | Description |
|---|---|---|
channel_names |
list[str]
|
|
name |
Literal['MULTIVARIATE_NUMERICAL']
|
|
UnivariateTimeSeriesFeature
#
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['UNIVARIATE_TIME_SERIES']
|
|
'UNIVARIATE_TIME_SERIES'
|
Methods:
| Name | Description |
|---|---|
to_model |
Convert to UnivariateTimeseriesFeatureType instance. |
Attributes:
| Name | Type | Description |
|---|---|---|
name |
Literal['UNIVARIATE_TIME_SERIES']
|
|
asynchronous |
bool
|
|
mirrored_channel |
str | None
|
|
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)
#
to_model() -> UnivariateTimeseriesFeatureType
#
Convert to UnivariateTimeseriesFeatureType instance.
Source code in src/xpdeep/dataset/feature/feature_types.py
MultivariateTimeSeriesFeature
#
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]
|
List of channel names used for visualization. |
required |
|
Literal['MULTIVARIATE_TIME_SERIES']
|
|
'MULTIVARIATE_TIME_SERIES'
|
Methods:
| Name | Description |
|---|---|
to_model |
Convert to MultivariateTimeseriesFeatureType instance. |
Attributes:
| Name | Type | Description |
|---|---|---|
channel_names |
list[str]
|
|
name |
Literal['MULTIVARIATE_TIME_SERIES']
|
|
asynchronous |
bool
|
|
channel_names: list[str]
#
name: Literal['MULTIVARIATE_TIME_SERIES'] = 'MULTIVARIATE_TIME_SERIES'
#
asynchronous: bool = field(default=False, kw_only=True)
#
to_model() -> MultivariateTimeseriesFeatureType
#
Convert to MultivariateTimeseriesFeatureType instance.
Source code in src/xpdeep/dataset/feature/feature_types.py
feature_type_from_model(json_response: dict[str, object]) -> NumericalFeature | CategoricalFeature | MultivariateNumericalFeature | UnivariateTimeSeriesFeature | MultivariateTimeSeriesFeature
#
Convert json features into the corresponding Feature.