set_preprocess

code_loader.leap_binder.set_preprocessing

The leap_binder.set_preprocessing binding function points to the Preprocessing Function, and sets the name for future reference.

code_loader.leap_binder.set_preprocess(
    function=Callable[[], List[PreprocessResponse]]
)
Args

function

Examples

Basic Usage

from code_loader import leap_binder
from code_loader.contract.datasetclasses import PreprocessingResponse

# Preprocessing Function
def preprocessing_func() -> List[PreprocessingResponse]:
...
    train = PreprocessingResponse(length=len(train_df), data=train_df)
    val = PreprocessingResponse(length=len(val_df), data=val_df)
    test = PreprocessingResponse(length=len(test_df), data=test_df)

    return [train, val, test]

leap_binder.set_preprocessing(function=preprocessing_func)

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