preprocessor
Feature preprocessor.
Preprocessor
#
Preprocessor class to preprocess the raw data.
preprocessed_size: if None indicate that this preprocessor was not fitted. Otherwise is the size of the feature after being preprocessed without the batch size.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
preprocessed_size |
tuple[int, ...] | None
|
|
None
|
preprocessed_size: tuple[int, ...] | None = None
#
IdentityPreprocessor
#
Identity Preprocessor class.
SklearnPreprocessor
#
Preprocessor class based on sklearn preprocessing classes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
preprocess_function |
TransformerMixin | ExposedPreprocessFunction
|
|
required |
dtype |
str
|
|
'float32'
|
preprocess_function: TransformerMixin | ExposedPreprocessFunction
#
dtype: str = 'float32'
#
as_exposed: ExposedNumpyPreprocessor
#
Generate the corresponding exposed feature.
from_exposed(numpy_preprocessor: ExposedNumpyPreprocessor) -> Self
#
Create SklearnPreprocessor from ExposedPreprocessArrowToTorchWithSklearn.
Source code in src/xpdeep/dataset/schema/preprocessor.py
transform(feature_raw_value: object) -> torch.Tensor
#
Transform a feature raw value into its preprocessed value.
Source code in src/xpdeep/dataset/schema/preprocessor.py
inverse_transform(preprocessed_value: torch.Tensor) -> object
#
Inverse transform a feature preprocessed value into its raw value.
Source code in src/xpdeep/dataset/schema/preprocessor.py
TorchPreprocessor(input_size: tuple[int, ...], module_transform: torch.nn.Module | None = None, module_inverse_transform: torch.nn.Module | None = None)
#
Preprocessor class based on sklearn preprocessing classes.
Size of input.
Source code in src/xpdeep/dataset/schema/preprocessor.py
input_size = input_size
#
ward = True
#
module_transform = module_transform
#
module_inverse_transform = module_inverse_transform
#
as_exposed: ExposedTorchPreprocessor
#
Generate the corresponding exposed feature.
forward(inputs: torch.Tensor) -> torch.Tensor
#
transform(inputs: torch.Tensor) -> torch.Tensor
#
Prpocess data: ie take in input a tensor and return the tensor preprocessed.
Source code in src/xpdeep/dataset/schema/preprocessor.py
inverse_transform(output: torch.Tensor) -> torch.Tensor
#
Reciprocal of preprocess.
ie \forall x inverse_transform(transform(x)) = transform(inverse_transform(x)) = x.
Source code in src/xpdeep/dataset/schema/preprocessor.py
from_exposed(exposed_torch_preprocessor: ExposedTorchPreprocessor) -> Self
#
Create SklearnPreprocessor from ExposedPreprocessArrowToTorchWithSklearn.