Expand description
Structs§
- Grid
Search - The result of
grid_search: each candidate’s mean score, and the best (lowest) one. - Split
- One train/test split: row indices into the data.
Functions§
- cross_
validate - Fits
modelon each split’s training rows and scores its predictions on the test rows withscore(y_test, predicted, test_design). Returns one score per split. Splits run in parallel (map_splits). - grid_
search - Scores every candidate in
candidatesbycross_validateon the same splits, withmake(candidate)building the model, and picks the lowest mean score (scores are losses: deviance, RMSE, CRPS). - group_
k_ fold - Grouped
k-fold: every row of a group lands in the same fold, so a policy or an insured seen in training never appears in its test set. Groups are shuffled withseedand dealt intokfolds. - k_fold
k-fold cross-validation: rows shuffled withseed, then cut intokfolds of near-equal size; foldiis the test set of spliti.- log_
uniform - A draw log-uniform between
lowandhigh(both positive): uniform in orders of magnitude, for learning rates and penalties. - map_
splits - Runs
fon every split in parallel on the Rayon pool (the outer loop, asdocs/architecture.mdprescribes) and returns the results in split order: the first error in split order, if any fails. Each split’s work is independent and seeded on its own, so results do not depend on the number of threads. - permutation
0..nshuffled by Fisher–Yates on streamstreamofseed: the permutation that the model-agnostic explanations in the bindings apply to a column, so they shuffle alike in Python and R.- random_
search - Random search: draws
ncandidates withdrawfrom stream 0 ofseed, then scores them asgrid_searchdoes. With several hyperparameters, random candidates cover each one’s range far better than a grid of the same size (Bergstra and Bengio, 2012), which is what neural networks need.log_uniformdraws scale parameters such as learning rates. - time_
ordered - Time-ordered splits for forecasting: for each of the last
n_testdistinct periodst, train on rows with period beforetand test on rows with periodt. For a reserving triangle, the period is the calendar diagonal (origin + development), and this is the diagonal backtest ofdocs/design/models.md. - uniform_
int - A draw uniform over
low..=high, for layer widths and counts.