NAME

PDL::ML::Preprocess - Machine learning preprocessing utilities for PDL ndarrays

SYNOPSIS

use PDL;
use PDL::ML::Preprocess qw(train_test_split standard_scale minmax_scale l2_normalize one_hot_encode);

my ($X_tr, $X_te, $y_tr, $y_te) = train_test_split($X, $y, test_size => 0.2, seed => 42);
my ($X_std, $mean, $std) = standard_scale($X_tr);
my $oh = one_hot_encode(long([0, 2, 1]), 3);

DESCRIPTION

PDL::ML::Preprocess provides common tabular and vector preprocessing functions (train/test splitting, standardization, min-max scaling, L2 normalization, and one-hot encoding) operating directly on PDL ndarrays.

AUTHOR

C.J. Collier <cjac@google.com>

LICENSE AND COPYRIGHT

Copyright 2026 Google LLC. Apache License, Version 2.0.