schema
Schemas.
Classes:
| Name | Description |
|---|---|
Schema |
Schema definition. Used as base class for AnalyzedSchema and FittedSchema classes. |
AnalyzedSchema |
A schema which represents the raw data structure: feature types and positions. |
FittedSchema |
A schema which represents the raw data structure: feature types and positions. |
Schema(*features: FEATURE_TYPE)
#
Schema definition. Used as base class for AnalyzedSchema and FittedSchema classes.
Initialize the class with the specified features.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
_FEATURE_TYPE
|
A variable number of features to be included. These features will be stored
in the |
()
|
Attributes:
| Name | Type | Description |
|---|---|---|
columns |
list[_FEATURE_TYPE]
|
A list containing the features provided during initialization. |
Methods:
| Name | Description |
|---|---|
__getitem__ |
Get a feature. |
__repr__ |
Represent the schema. |
Attributes:
| Name | Type | Description |
|---|---|---|
columns |
list[FEATURE_TYPE]
|
|
Source code in src/xpdeep/dataset/schema.py
columns: list[FEATURE_TYPE] = list(features)
#
__getitem__(feature_name: str) -> FEATURE_TYPE
#
Get a feature.
Source code in src/xpdeep/dataset/schema.py
__repr__() -> str
#
Represent the schema.
Source code in src/xpdeep/dataset/schema.py
AnalyzedSchema(*features: FEATURE_TYPE)
#
A schema which represents the raw data structure: feature types and positions.
Methods:
| Name | Description |
|---|---|
from_model |
Create the client object from api response. |
remove_feature |
Remove the feature with the given name from the schema, and return the removed feature. |
__setitem__ |
Set the feature with the given name from the parquet dataset analyzed schema. |
__delitem__ |
Delete feature. |
Attributes:
| Name | Type | Description |
|---|---|---|
as_fit_schema_pipeline_input_schema |
list[FeatureInsert | IndexMetadataInsert | MetadataInsert]
|
Convert to FeatureInsert or IndexMetadataInsert instance. |
Source code in src/xpdeep/dataset/schema.py
as_fit_schema_pipeline_input_schema: list[FeatureInsert | IndexMetadataInsert | MetadataInsert]
#
Convert to FeatureInsert or IndexMetadataInsert instance.
from_model(json_response: dict[str, object]) -> AnalyzedSchema
#
Create the client object from api response.
Source code in src/xpdeep/dataset/schema.py
remove_feature(feature_name: str) -> ExplainableFeature | BaseFeature | IndexMetadata
#
Remove the feature with the given name from the schema, and return the removed feature.
Source code in src/xpdeep/dataset/schema.py
__setitem__(feature_name: str, new_feature: ExplainableFeature | BaseFeature) -> None
#
Set the feature with the given name from the parquet dataset analyzed schema.
Source code in src/xpdeep/dataset/schema.py
FittedSchema(*features: ExplainableFeature | IndexMetadata, input_size: tuple[int, ...], target_size: tuple[int, ...])
#
A schema which represents the raw data structure: feature types and positions.
Initialize the FittedSchema instance.
The FittedSchema may be directly returned after an analyzed step, with AnalyzedParquetDataset.fit but may also be constructed from scratch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
ExplainableFeature | IndexMetadata
|
A feature or metadata object, fitted. |
()
|
|
tuple[int, ...]
|
The size of the input data (with the first dimension being batch dimension), used by pytorch to serialize the associated models. |
required |
|
tuple[int, ...]
|
The size of the target data (with the first dimension being batch dimension), used by pytorch to serialize the associated models. |
required |
Methods:
| Name | Description |
|---|---|
from_model |
Convert to FittedSchema. |
to_model |
Convert to DatasetArtifactSchemaInsert instance. |
add_augmentation |
When the schema is fitted, augmentation can be added to features. |
Attributes:
| Name | Type | Description |
|---|---|---|
input_size |
|
|
target_size |
|
Source code in src/xpdeep/dataset/schema.py
input_size = input_size
#
target_size = target_size
#
from_model(json_response: dict[str, object]) -> FittedSchema
#
Convert to FittedSchema.
Source code in src/xpdeep/dataset/schema.py
to_model() -> DatasetArtifactSchemaInsert
#
Convert to DatasetArtifactSchemaInsert instance.
Source code in src/xpdeep/dataset/schema.py
add_augmentation(feature_name: str, augmentation: ImageFeatureAugmentation) -> None
#
When the schema is fitted, augmentation can be added to features.