@tensorleap_preprocess

code_loader.inner_leap_binder.leapbinder_decorators.tensorleap_preprocess

The tensorleap_preprocess decorates a Preprocessing Function

@tensorleap_preprocess()
def preprocess_func_leap() -> List[PreprocessResponse]:
    pass

Examples

Basic Usage

from code_loader.contract.datasetclasses import PreprocessResponse
from code_loader.contract.enums import DataStateType
from code_loader.inner_leap_binder.leapbinder_decorators import tensorleap_preprocess

# Preprocessing Function
@tensorleap_preprocess()
def preprocessing_func() -> List[PreprocessResponse]:
    ...
    train = PreprocessResponse(length=len(train_df), data=train_df, state=DataStateType.training)
    val = PreprocessResponse(length=len(val_df), data=val_df, state=DataStateType.validation)
    test = PreprocessResponse(length=len(test_df), data=test_df, state=, state=DataStateType.test)
    unlabeled = PreprocessResponse(length=len(test_df), data=test_df, state=, state=DataStateType.unlabeled)

    return [train, val, test, unlabeled]

Usage within the full script can be found at the Dataset Script.

Guides

Full examples can be found at the Dataset Integration section of the following guides:

Last updated

Was this helpful?