All examples
Data

Audited dataset partitions and batches

Load offline Iris, preserve training roles, fit scaling on training rows and inspect deterministic batches and folds.

dataset_partitions.aner
// Offline source roles, training-only scaling, lazy batches and folds.
import aner.dataset
import aner.tensor

let parts = dataset.iris().partition(validation: 0.2, test: 0.2, seed: 42)
let training = parts.train()
let validation = parts.validation()
let testing = parts.test()
dataset.require_training(training)
dataset.require_disjoint(training, validation)
dataset.require_disjoint(training, testing)
print(training.rows())
print(validation.rows())
print(testing.rows())
print(training.role())
let scaler = training.fit_standardizer()
let prepared = dataset.transform(scaler, validation.features())
print(prepared.rows())
print(prepared.cols())
for batch in training.batches(size: 16, seed: 42, shuffle: true) {
    print(batch.rows())
}
let folds = dataset.iris().kfold(count: 5, seed: 2026)
print(folds.count())
let first = folds.fold(index: 0)
print(first.train().rows())
print(first.validation().rows())

Make it your experiment.

With Aner installed, save this program as examples/dataset_partitions.aner inside a folder for your experiment. Open a terminal in that folder, then check and run the program.

Terminal
aner check examples/dataset_partitions.aner
aner run examples/dataset_partitions.aner

The aner command must be on your PATH. Follow the installation guide if your terminal cannot find it.

Use a compatible current native Aner executable. This complete example runs locally with the declared inputs; the guide explains exact shapes, expected results and resource limits.

Bundled datasets retain their own source attribution and license notices. Example outcomes are not comparative benchmarks or evidence of clinical validity.

Dataset sources & attribution
Install Aner