feature_types
Access all feature types.
Modules:
| Name | Description |
|---|---|
abstract_type |
Abstract feature type interface. |
bbox |
Bbox related features. |
categorical |
Categorical and ordinal features. |
feature_from_model |
Utility function to infer feature type from an unknow json response. |
histogram |
Histogram feature types. |
image |
Image feature types. |
list |
List feature types. |
numerical |
Numerical feature types. |
time_series |
Time series feature types. |
vector |
Vector feature and type alias. |
Type Aliases:
| Name | Description |
|---|---|
FeatureTypeUnion |
|
Classes:
| Name | Description |
|---|---|
FeatureType |
Abstract class representing a feature type. |
BboxFeature |
Feature representing a bounding box. |
BoundingBoxesFeature |
Feature representing a list of bounding boxes within a single image. |
CategoricalFeature |
Categorical feature. |
OrdinalFeature |
Feature representing an ordered categorical variable. |
HistogramFeature |
Feature representing a histogram-based data distribution. |
ImageFeature |
Feature representing an image input or output. |
ListFeature |
Feature representing a collection of sub-features without temporal ordering. |
NumericalFeature |
Numerical feature. |
MultivariateTimeSeriesFeature |
Feature representing a multivariate time series. |
TimeSeriesFeature |
Feature representing a temporal sequence of sub-features. |
UnivariateTimeSeriesFeature |
Alias type representing a univariate time series. |
MultivariateNumericalFeature |
MultivariateNumericalFeature feature. |
VectorFeature |
Feature representing a vector composed of multiple sub-features. |
__all__ = ['BboxFeature', 'BboxFeature', 'BoundingBoxesFeature', 'CategoricalFeature', 'FeatureType', 'FeatureTypeUnion', 'HistogramFeature', 'ImageFeature', 'ListFeature', 'MultivariateNumericalFeature', 'MultivariateNumericalFeature', 'MultivariateTimeSeriesFeature', 'NumericalFeature', 'OrdinalFeature', 'TimeSeriesFeature', 'UnivariateTimeSeriesFeature', 'VectorFeature']
#
FeatureTypeUnion = BboxFeature | CategoricalFeature | OrdinalFeature | HistogramFeature | ImageFeature | ListFeature[FeatureType] | NumericalFeature | TimeSeriesFeature[FeatureType] | VectorFeature[FeatureType]
#
FeatureType
#
Abstract class representing a feature type.
Methods:
| Name | Description |
|---|---|
to_model |
Convert to an Api client feature type. |
stable_hash |
Return the feature type hash based on its database model. |
from_model |
Instantiate from a json response. |
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
|
BboxFeature
#
Feature representing a bounding box.
This feature represents a single bbox in YOLO format for object detection tasks described by positional coordinates, class category, and detection score.
Bounding boxes follow the YOLO format, where each box is parameterized by:
- center_x and center_y: normalized coordinates of the box center within the image.
- width and height: normalized dimensions of the box.
- class: category index or label of the detected object.
- score: confidence score associated with the detection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
list[int] or list[str]
|
List of category identifiers or labels corresponding to the possible object classes. |
required |
Notes
- This feature is mostly meant to be used through
BoundingBoxesFeature
Methods:
| Name | Description |
|---|---|
to_model |
Convert to a |
from_model |
Instantiate from a json response. |
Attributes:
| Name | Type | Description |
|---|---|---|
categories |
list[int] | list[str]
|
|
name |
Literal['BBOX']
|
|
categories: list[int] | list[str]
#
name: Literal['BBOX'] = 'BBOX'
#
to_model() -> BBoxFeatureType
#
Convert to a ListFeatureTypeInput instance.
Returns:
| Type | Description |
|---|---|
ListFeatureTypeInput
|
Model-level representation of the bounding boxes feature, including the serialized box structure and category information. |
Source code in src/xpdeep/dataset/feature/feature_types/bbox.py
from_model(feature_type_input: BBoxFeatureType) -> BboxFeature
#
BoundingBoxesFeature
#
Feature representing a list of bounding boxes within a single image.
This feature encodes object detections as a collection of bounding boxes, each described by positional coordinates, class category, and detection score. It provides a structured way to represent outputs from object detection models or annotated datasets.
Bounding boxes follow the YOLO format, where each box is parameterized by:
- center_x and center_y: normalized coordinates of the box center within the image.
- width and height: normalized dimensions of the box.
- class: category index or label of the detected object.
- score: confidence score associated with the detection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
list[int] or list[str]
|
List of category identifiers or labels corresponding to the possible object classes. |
required |
Notes
- Bounding boxes are represented as a list of homogeneous sub-features.
- This feature is typically used to represent detections within a single image or frame.
- Current limitation: Xpdeep does not yet support variable numbers of detections per instance. Please pad bounding box lists to a uniform length before using this feature.
Attributes:
| Name | Type | Description |
|---|---|---|
items |
str
|
|
Methods:
| Name | Description |
|---|---|
__attrs_post_init__ |
Update categories. |
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
|
Methods:
| Name | Description |
|---|---|
to_model |
Convert to CategoricalFeatureType instance. |
parse_categories_to_list |
Convert categories to an empty list if they are None. |
__attrs_post_init__ |
Return a fake category to be overwritten by the fitted preprocessor inferred categories. |
from_model |
Instantiate from a json response. |
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.
parse_categories_to_list(categories: list[str] | list[int] | None) -> list[str] | list[int]
#
Convert categories to an empty list if they are None.
Source code in src/xpdeep/dataset/feature/feature_types/categorical.py
__attrs_post_init__() -> None
#
Return a fake category to be overwritten by the fitted preprocessor inferred categories.
from_model(feature_type_input: CategoricalFeatureType) -> CategoricalFeature
#
Instantiate from a json response.
Source code in src/xpdeep/dataset/feature/feature_types/categorical.py
OrdinalFeature
#
Feature representing an ordered categorical variable.
An ordinal feature encodes categories that have a defined order or ranking, such as "low", "medium", "high". In contrast to nominal (unordered) categories, ordinal features include a notion of distance between categories, quantified by an associated cost matrix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
list[str] or list[int]
|
Ordered list of category labels. The order in the list must correspond to the order used in the cost matrix. |
required |
|
ndarray
|
Two-dimensional matrix specifying the pairwise cost or distance between categories. The entry at position (i, j) represents the cost of moving from category i to category j. |
required |
Methods:
| Name | Description |
|---|---|
to_model |
Convert to an |
from_model |
Instantiate from a json response. |
Attributes:
| Name | Type | Description |
|---|---|---|
categories |
list[str] | list[int]
|
|
cost_matrix |
ndarray
|
|
name |
Literal['ORDINAL']
|
|
categories: list[str] | list[int]
#
cost_matrix: np.ndarray
#
name: Literal['ORDINAL'] = 'ORDINAL'
#
to_model() -> OrdinalFeatureType
#
Convert to an OrdinalFeatureType instance.
Returns:
| Type | Description |
|---|---|
OrdinalFeatureType
|
A feature model representation including the category list and cost matrix. |
Source code in src/xpdeep/dataset/feature/feature_types/categorical.py
from_model(feature_type_input: OrdinalFeatureType) -> OrdinalFeature
#
Instantiate from a json response.
Source code in src/xpdeep/dataset/feature/feature_types/categorical.py
HistogramFeature
#
Feature representing a histogram-based data distribution.
This feature encodes the statistical distribution of values through histogram bins. It can be used to summarize numerical data, such as activation distributions, probability outputs, or pixel intensity histograms in an image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
tuple[str, ...]
|
Names of the histogram bins. Each entry typically corresponds to a range or label describing the data segment represented by the bin. |
required |
|
list[float] or None
|
Numerical values representing the histogram counts or frequencies for each bin. |
None
|
Methods:
| Name | Description |
|---|---|
to_model |
Convert to a |
from_model |
Instantiate from a json response. |
Attributes:
| Name | Type | Description |
|---|---|---|
bin_names |
tuple[str, ...]
|
|
bins |
list[float] | None
|
|
name |
Literal['HISTOGRAM']
|
|
bin_names: tuple[str, ...]
#
bins: list[float] | None = None
#
name: Literal['HISTOGRAM'] = 'HISTOGRAM'
#
to_model() -> HistogramFeatureType
#
Convert to a HistogramFeatureType instance.
Returns:
| Type | Description |
|---|---|
HistogramFeatureType
|
A feature model representation including the bin names and bin values. |
Source code in src/xpdeep/dataset/feature/feature_types/histogram.py
from_model(feature_type_input: HistogramFeatureType) -> HistogramFeature
#
Instantiate from a json response.
Source code in src/xpdeep/dataset/feature/feature_types/histogram.py
ImageFeature
#
Feature representing an image input or output.
This feature models image data as a multidimensional numerical tensor with pixel intensities arranged in channel-last format. It is typically used to represent visual inputs such as photographs, rendered scenes, or segmentation masks.
The expected tensor shape is (batch_size, height, width, num_channels),
where:
- height and width are the spatial dimensions of the image,
- num_channels corresponds to the color or modality channels (for example,
1 for grayscale, 3 for RGB, 4 for RGBA, or more for multispectral images).
Notes
- Image data must use the channel-last layout (H x W x C).
- The numerical type and normalization of pixel values depend on the associated preprocessing pipeline (for example, values in [0, 1] or [0, 255]).
- Current limitation: Xpdeep assumes fixed image dimensions across all instances of the dataset; resizing or cropping should be handled during preprocessing.
Methods:
| Name | Description |
|---|---|
to_model |
Convert to an |
from_model |
Image from model. |
Attributes:
| Name | Type | Description |
|---|---|---|
name |
Literal['IMAGE']
|
|
name: Literal['IMAGE'] = 'IMAGE'
#
to_model() -> ImageFeatureType
#
Convert to an ImageFeatureType instance.
Returns:
| Type | Description |
|---|---|
ImageFeatureType
|
Model-level representation of the image feature, including its static structural definition. |
Source code in src/xpdeep/dataset/feature/feature_types/image.py
from_model(feature_type_input: ImageFeatureType) -> ImageFeature
#
ListFeature
#
Feature representing a collection of sub-features without temporal ordering.
A list feature encodes a variable-length sequence of feature instances that share
the same feature type, defined by items. In contrast to TimeSeriesFeature,
a list does not imply any temporal or sequential relationship between elements;
it simply groups multiple instances of the same feature together.
This structure is suitable for representing sets or collections of homogeneous entities, such as a list of detected objects, word embeddings, or samples within a batch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
ItemType
|
Feature type of each element in the list. All elements must share the same underlying feature definition. |
required |
Notes
- The order of elements in the list is not semantically meaningful.
- This feature type is close to a
TimeSeriesFeaturewithout temporal context. It can be used for unordered sequences or collections of arbitrary length. - Current limitation: Xpdeep does not yet support variable-length lists. Please pad all lists to a uniform length before using this feature.
Methods:
| Name | Description |
|---|---|
to_model |
Convert to a |
from_model |
Instantiate from a json response. |
Attributes:
| Name | Type | Description |
|---|---|---|
items |
ItemType
|
|
name |
Literal['LIST']
|
|
items: ItemType
#
name: Literal['LIST'] = 'LIST'
#
to_model() -> ListFeatureTypeInput
#
Convert to a ListFeatureTypeInput instance.
Returns:
| Type | Description |
|---|---|
ListFeatureTypeInput
|
Model-level representation of the list feature, including its serialized item feature type. |
Source code in src/xpdeep/dataset/feature/feature_types/list.py
from_model(feature_type_input: ListFeatureTypeInput) -> ListFeature[ItemType]
#
Instantiate from a json response.
Source code in src/xpdeep/dataset/feature/feature_types/list.py
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 |
|---|---|
to_model |
Convert to NumericalFeatureType instance. |
from_model |
Instantiate from a json response. |
Attributes:
| Name | Type | Description |
|---|---|---|
name |
Literal['NUMERICAL']
|
|
MultivariateTimeSeriesFeature
#
Feature representing a multivariate time series.
This feature models a temporal sequence of synchronized numerical channels.
Each time step is represented as a vector of numerical values, one per channel.
It is equivalent to a TimeSeriesFeature of a VectorFeature composed of
numerical sub-features.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
|
False
|
|
str
|
|
None
|
|
str
|
|
required |
Attributes:
| Name | Type | Description |
|---|---|---|
items |
str
|
|
Methods:
| Name | Description |
|---|---|
__attrs_post_init__ |
Update categories. |
TimeSeriesFeature
#
Feature representing a temporal sequence of sub-features.
A time series feature encodes a sequence of feature instances observed over time.
Each element in the series shares the same feature type and structure, defined by
the items attribute. This representation is suitable for modeling dynamic
signals, evolving states, or sequential sensor measurements.
The asynchronous flag indicates cross-instance temporal alignment at the dataset
level: when True, different samples in the dataset need not be aligned in time
(for example, sequences may have different start times,or sampling
schedules). When False, sequences across instances are expected to be aligned
(for example, same timestamps or a shared index), enabling direct time-wise
comparisons.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
ItemType
|
The feature type representing each element in the temporal sequence. This defines the internal structure and semantics of the time-dependent data. |
required |
|
bool
|
Indicate whether sequences across dataset instances are temporally aligned. If True, instances may be misaligned (different start times, lengths, or grids). If False, instances are aligned to a common temporal reference. |
False
|
|
tuple[str, str] or str or None
|
Define the link to another feature for visualization in XpViz. - A string refers to the feature name of another time series. - A tuple (feature_name, channel_name) refers to a channel within another multivariate time series feature. |
None
|
Notes
This class does not prescribe intra-sequence sampling regularity. Individual
sequences may be regularly or irregularly sampled regardless of the value of
asynchronous.
- Current limitation: Xpdeep does not yet support variable-length sequences. Please pad all sequences to a uniform length before using this feature.
Tip
If your architecture requires explicit temporal information (for example, to encode absolute or relative time), consider adding a new feature timestamp of type TimeSeries[Numerical] to your schema. This feature can represent time indices or real-world timestamps aligned with the sequence entries and will be accessible by your model.
Methods:
| Name | Description |
|---|---|
to_model |
Convert to a |
from_model |
Instantiate from a json response. |
Attributes:
| Name | Type | Description |
|---|---|---|
items |
ItemType
|
|
name |
Literal['TIMESERIES']
|
|
asynchronous |
bool
|
|
channel |
tuple[str, str] | str | None
|
|
items: ItemType
#
name: Literal['TIMESERIES'] = 'TIMESERIES'
#
asynchronous: bool = attrs.field(default=False, kw_only=True)
#
channel: tuple[str, str] | str | None = attrs.field(default=None, kw_only=True)
#
to_model() -> TimeseriesFeatureTypeInput
#
Convert to a TimeseriesFeatureTypeInput instance.
Returns:
| Type | Description |
|---|---|
TimeseriesFeatureTypeInput
|
Model-level representation of the time series feature, including its temporal structure and asynchronicity flag. |
Source code in src/xpdeep/dataset/feature/feature_types/time_series.py
from_model(feature_type_input: TimeseriesFeatureTypeInput) -> TimeSeriesFeature[ItemType]
#
Instantiate from a json response.
Source code in src/xpdeep/dataset/feature/feature_types/time_series.py
UnivariateTimeSeriesFeature
#
Alias type representing a univariate time series.
This feature models a temporal sequence of numerical values observed over time,
corresponding to a single channel or variable. It is equivalent to a
TimeSeriesFeature composed of a single NumericalFeature.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
|
False
|
|
str
|
|
None
|
Attributes:
| Name | Type | Description |
|---|---|---|
items |
str
|
|
Methods:
| Name | Description |
|---|---|
__attrs_post_init__ |
Update categories. |
MultivariateNumericalFeature
#
MultivariateNumericalFeature feature.
It is an alias for a VectorFeature of Numerical items.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
List[str]
|
List of channel names used for visualization. |
required |
Notes
- Conceptually equivalent to:
VectorFeature(items=NumericalFeature, channel_names).
Attributes:
| Name | Type | Description |
|---|---|---|
items |
str
|
|
Methods:
| Name | Description |
|---|---|
__attrs_post_init__ |
Update categories. |
VectorFeature
#
Feature representing a vector composed of multiple sub-features.
A vector feature encapsulates a collection of individual feature components (for example, numerical or categorical) grouped together under named channels. Each element of the vector corresponds to a distinct dimension identified by a channel name, and all elements share the same underlying feature type.
This structure is suitable for representing multidimensional entities such as
coordinates, embeddings, or multi-attribute descriptors. For instance, a 3D point
can be represented as a vector of three numerical features with channel names
("x", "y", "z"). Ideally, the channels of a vector feature should be
statistically independent.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
ItemType
|
The feature type associated with each channel. This defines the structure and semantics of the individual vector components. |
required |
|
tuple[str, ...]
|
Sequence of names identifying each channel in the vector. The order of the names must match the order of the corresponding feature components. |
required |
Methods:
| Name | Description |
|---|---|
to_model |
Convert to a |
from_model |
Instantiate from a json response. |
Attributes:
| Name | Type | Description |
|---|---|---|
items |
ItemType
|
|
channel_names |
tuple[str, ...]
|
|
name |
Literal['VECTOR']
|
|
items: ItemType
#
channel_names: tuple[str, ...]
#
name: Literal['VECTOR'] = 'VECTOR'
#
to_model() -> VectorFeatureTypeInput
#
Convert to a VectorFeatureTypeInput instance.
Returns:
| Type | Description |
|---|---|
VectorFeatureTypeInput
|
Model-level representation of the vector feature, including its channel names and the serialized form of its item feature type. |
Source code in src/xpdeep/dataset/feature/feature_types/vector.py
from_model(feature_type_input: VectorFeatureTypeInput) -> VectorFeature[ItemType]
#
Instantiate from a json response.