feature_types
Feature types module.
Classes:
| Name | Description |
|---|---|
NumericalFeature |
Numerical feature. |
CategoricalFeature |
Categorical feature. |
ImageFeature |
Image feature. |
MultivariateNumericalFeature |
MultivariateNumericalFeature feature. |
UnivariateTimeSeriesFeature |
UnivariateTimeSerie feature. |
MultivariateTimeSeriesFeature |
MultivariateTimeSeries feature. |
BoundingBoxesFeature |
Feature that represents a list of bounding boxes, detection in a single image for instance. |
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.
ImageFeature
#
Image feature.
It represents image feature objects. The corresponding data should use the channel-last format, i.e. batch_size x H x W x num_channels.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Literal['IMAGE']
|
|
'IMAGE'
|
Methods:
| Name | Description |
|---|---|
to_model |
Convert to ImageFeatureType instance. |
Attributes:
| Name | Type | Description |
|---|---|---|
name |
Literal['IMAGE']
|
|
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 VectorFeatureTypeInput 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.
|
|
tuple[str, str] | 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_TIMESERIES']
|
|
'UNIVARIATE_TIMESERIES'
|
Methods:
| Name | Description |
|---|---|
to_model |
Convert to TimeseriesFeatureTypeInput instance. |
Attributes:
| Name | Type | Description |
|---|---|---|
name |
Literal['UNIVARIATE_TIMESERIES']
|
|
asynchronous |
bool
|
|
channel |
tuple[str, str] | str | None
|
|
name: Literal['UNIVARIATE_TIMESERIES'] = 'UNIVARIATE_TIMESERIES'
#
asynchronous: bool = field(default=False, kw_only=True)
#
channel: tuple[str, str] | str | None = field(default=None, kw_only=True)
#
to_model() -> TimeseriesFeatureTypeInput
#
Convert to TimeseriesFeatureTypeInput 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_TIMESERIES']
|
|
'MULTIVARIATE_TIMESERIES'
|
Methods:
| Name | Description |
|---|---|
to_model |
Convert to TimeseriesFeatureTypeInput instance. |
Attributes:
| Name | Type | Description |
|---|---|---|
channel_names |
list[str]
|
|
name |
Literal['MULTIVARIATE_TIMESERIES']
|
|
asynchronous |
bool
|
|
channel_names: list[str]
#
name: Literal['MULTIVARIATE_TIMESERIES'] = 'MULTIVARIATE_TIMESERIES'
#
asynchronous: bool = field(default=False, kw_only=True)
#
to_model() -> TimeseriesFeatureTypeInput
#
Convert to TimeseriesFeatureTypeInput instance.
Source code in src/xpdeep/dataset/feature/feature_types.py
BoundingBoxesFeature
#
Feature that represents a list of bounding boxes, detection in a single image for instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
list[int] | list[str]
|
The categories that the bounding boxes represent. |
required |
|
Literal['BBOX_LIST']
|
The feature name. |
'BBOX_LIST'
|
|
tuple[str, ...]
|
The expected channel names for a single bounding box expected format is its class, its position, and the detection score. |
('class', 'center_x', 'center_y', 'width', 'height', 'score')
|
Methods:
| Name | Description |
|---|---|
to_model |
Convert to BBoxListFeatureType instance. |
Attributes:
| Name | Type | Description |
|---|---|---|
categories |
list[int] | list[str]
|
|
name |
Literal['BBOX_LIST']
|
|
channel_names |
tuple[str, ...]
|
|
categories: list[int] | list[str]
#
name: Literal['BBOX_LIST'] = 'BBOX_LIST'
#
channel_names: tuple[str, ...] = ('class', 'center_x', 'center_y', 'width', 'height', 'score')
#
to_model() -> ListFeatureTypeInput
#
Convert to BBoxListFeatureType 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 | ImageFeature | BoundingBoxesFeature
#
Convert json features into the corresponding Feature.