Skip to content

Ordinal Grid Search Node

AI/ML/Tuning

Exhaustively searches the hyperparameters of ONE ordinal model family with cross-validation, for a target whose levels are ORDERED (1 < 2 < ... < 5, or low < medium < high). Every combination in the Parameter Grid is scored on the SAME folds and ranked by an ordinal metric that knows how far a miss was. Use this rather than Grid Search, which resolves the target without its order and tunes against accuracy, scoring a five-level miss exactly like a one-level one. Model Type accepts the names Auto Ordinal reports as its best model, so the usual chain is Auto Ordinal to pick the family, then this node to tune it. Every family here is a gradient or a least-squares fit on the raw columns, so scale your features with the Fit Feature Scaler node first: unscaled columns change which hyperparameters win, not just how fast they converge.

ai_ml_tuning_ordinal_grid_searchml
Inputs7
Outputs6
Security exposure6/10
Packageml

Ratings

Scores range from 0 to 10. Higher values mean more impact, exposure, or operational weight.

SecurityAttack surface and exposure impact.
6/10Medium
PrivacyPotential sensitivity of processed data.
6/10Medium
PerformanceRuntime or resource pressure.
3/10Low
GovernancePolicy, audit, or compliance impact.
8/10High
ReliabilityOperational stability considerations.
7/10High
CostExternal or compute cost impact.
3/10Low

Input Pins

7

Input

Execution
exec_in

Execution trigger that starts the sweep

Data Source

String
source

Choose which backend supplies the training data

Default Database
Database

Model Type

String
model_type

Which ordinal family to tune. OrdinalLogistic is the threshold model, the widest family here: it takes a link, a loss and a margin, and covers proportional odds, ordered probit and support vector ordinal regression. OrdinalRidge is rank regression with learned cut points, closed-form and so by far the cheapest to sweep, but it has only a penalty to tune. OrdinalContinuationRatio models a sequential progression, `P(stop at k | reached k)`. OrdinalAdjacentCategory contrasts neighbouring levels instead of splitting the scale cumulatively. OrdinalNeural is a small network under a rank-consistent CORAL or CORN head, the only family here that is not linear in the features and the only one that can represent a level that is not monotone in them - and by a wide margin the most expensive to sweep, since every combination trains a whole network from scratch on every fold, so keep its grid small. Switching this after the Parameter Grid was seeded does NOT rewrite the grid - the run rejects parameters the new family does not consume rather than ignoring them silently.

Default OrdinalLogistic
OrdinalLogisticOrdinalRidgeOrdinalContinuationRatioOrdinalAdjacentCategoryOrdinalNeural

Class Order

String
class_order

Comma-separated level labels from LOWEST to HIGHEST, e.g. `low, medium, high`. Leave empty when the levels are numeric and their numeric order is the order you want. Non-numeric labels have no inferable order, so the search fails rather than guessing one. The level set is resolved once here and handed to every fit, so a level that a fold happens to miss cannot renumber the ranks for that fold.

CV Folds

Integer
cv_folds

How many folds the rows are split into. Every combination is scored on the SAME folds, so the comparison is paired rather than a race between different splits. More folds mean a less noisy score and proportionally more fitting, since the whole grid is refitted once per fold.

Default 5
Range 2 to 50

Metric

String
metric

What the sweep is ranked by. Quadratic Kappa is chance-corrected agreement that forgives a near miss and punishes a distant one four times as hard - the standard headline metric for ordered targets. Linear Kappa charges the same for every step along the scale, which is what you want when one level is one unit of loss. Mean Rank Error is the average number of levels a prediction is off by, and Macro Rank Error is the same averaged per true level so a rare level counts as much as the majority one - both are ERROR metrics, so the SMALLEST value wins and the `higher_is_better` output says so. Kendall Tau-b and Spearman ask only whether the rows come out in the right order and ignore calibration entirely, so a model whose levels are all shifted by one still scores perfectly.

Default Quadratic Kappa
Quadratic KappaLinear KappaMean Rank ErrorMacro Rank ErrorKendall Tau-bSpearman

Seed

Integer
seed

Seed for the fold shuffle, and for the weight initialization when Model Type is OrdinalNeural - the two sources of randomness in the sweep, tied to one value so the same seed reproduces the same folds, the same fits and therefore the same winner. Change it to check whether a narrow win survives a different split, which for the neural family also re-rolls the starting point of a non-convex fit. The winner is retrained from the same initialization it was scored at.

Default 42
Range 0 to 4294967295

Output Pins

6

Done

Execution
exec_out

Activated once the sweep completes

Results

Struct
results

Every combination that completed all folds with its mean and spread across the folds, plus the ones that were dropped and why. `higher_is_better` states which end of `mean_score` won.

OrdinalGridSearchResultOrdinalGridSearchResult13 fields
resultsArray<GridSearchEntry>required

Every combination that completed all folds, in the order the grid produced them.

itemsGridSearchEntryarray item

Results from a single parameter combination in grid search

paramsobjectrequired

Parameter values used for this run

mean_scorenumber:doublerequired

Mean CV score across all folds

format double
std_scorenumber:doublerequired

Standard deviation of CV scores

format double
fold_scoresArray<number:double>required

Individual fold scores

itemsnumber:doublearray item
format double
train_time_secsnumber:doublerequired

Training time in seconds

format double
skippedArray<OrdinalGridSearchSkip>required

Combinations excluded because a fold could not be fitted, with the reason.

itemsOrdinalGridSearchSkiparray item

A parameter combination that was dropped from the sweep because it could not be fitted.

paramsobjectrequired

The combination that failed, as it appeared in the grid.

reasonstringrequired

Which fold it failed on and what the estimator reported.

best_indexinteger:uintrequired

Index of the winning entry inside `results`.

format uintmin 0
best_paramsobjectrequired

Hyperparameters of the winner.

best_scorenumber:doublerequired

Mean cross-validated score of the winner, in the units of `metric`.

format double
model_typestringrequired

Model family that was tuned, e.g. `OrdinalLogistic`.

metricstringrequired

Metric the sweep was ranked by.

higher_is_betterbooleanrequired

False for the two error metrics, where the SMALLEST `mean_score` is the winner.

total_time_secsnumber:doublerequired

Wall clock seconds for the whole sweep, including data loading and the final refit.

format double
n_combinationsinteger:uintrequired

Size of the cartesian product of the grid. Combinations counted in `skipped` are included here but absent from `results`.

format uintmin 0
n_foldsinteger:uintrequired

Number of cross-validation folds.

format uintmin 0
n_levelsinteger:uintrequired

Number of ordered levels every configuration was fitted against.

format uintmin 0
n_samplesinteger:uintrequired

Rows the sweep ran on.

format uintmin 0

Best Model

Struct
best_model

The winning combination retrained on the full dataset. Predictions come back as your original level labels.

NodeMLModelNodeMLModel1 fields
model_refstringrequired
Schema enforced

Best Score

Float
best_score

Mean cross-validated score of the winner, in the units of the chosen metric. Meaningless without Higher Is Better: for the two error metrics this is the SMALLEST score in the sweep, not the largest.

Higher Is Better

Boolean
higher_is_better

Direction of the chosen metric: true for the agreement measures, false for MeanAbsoluteRankError and MacroMeanAbsoluteError, where a smaller score is the better model. Branch on this rather than assuming, otherwise a comparison downstream will rank the sweep upside down.

Levels

Struct
levels

The level order every configuration was trained on, lowest first, plus whether it came from your Class Order list (Explicit) or from reading the labels as numbers (Numeric). Check this first when the results look upside down.

OrdinalLevelsOrdinalLevels2 fields
labelsArray<string>required

Level labels from lowest to highest; the index is the rank the model was trained on.

itemsstringarray item
orderingOrdinalOrderingrequired

Where the ordering came from.

variant 1constvariant

Every distinct label parsed as a number, so the order is the numeric one.

const "Numeric"
variant 2constvariant

The caller supplied the order explicitly.

const "Explicit"

Node Info

Internal name
ai_ml_tuning_ordinal_grid_search
Category
AI/ML/Tuning