public fit(notnull features as NDArray<T>, notnull targets as NDArray<T>, epochs as Long = 5l, batchSize as Long = 64l, shuffle as Boolean = true, seed as Long = 12345l, verbose as Int = 1, validationData as Tuple<NDArray<T>, NDArray<T>> = null) as TrainingHistory
Trains on same-precision floating targets using the configured regression loss. Targets match the model output shape; [samples] is accepted for [samples, 1] outputs. Progress/history expose loss and optional val_loss, never classification accuracy. Batch reuse, shuffling, validation and Float16 loss scaling follow the classification fit contract.
| Parameter | Description |
|---|---|
features | Batched inputs, retained only for this call. |
targets | Finite floating expected values in T. |
epochs | Positive number of passes. |
batchSize | Maximum observations per batch. |
shuffle | Shuffle sample indices without modifying either input. |
seed | Local seed in [1, 2147483646]. |
verbose | 0 silent, 1 batch progress, 2 epoch summaries. |
validationData | Optional independent floating-target validation split. |
Sample-weighted, loss-only history.
history = model.fit(xTrain, yTrain, epochs=20, validationData=(xTest, yTest))