Skip to content

Train Ordinal Model (Neural CORAL/CORN) Node

AI/ML/Ordinal

Fit/Train a NEURAL ordinal model on a target whose levels are ORDERED (1 < 2 < ... < 5, or low < medium < high). This is the only trainer in the catalog that is BOTH non-linear in the features AND yields calibrated, rank-consistent per-level probabilities: Frank & Hall is non-linear but votes with K-1 independent classifiers and therefore carries no probability model, while every other ordinal node here is linear in the features. A small network feeds one of two rank-consistent heads, CORAL or CORN, and both are built so that P(y > k) can never rise with k for ANY parameter values — so the level probabilities are non-negative and sum to 1 with nothing patched up afterwards. THE HONEST LIMIT: leave Hidden Layers EMPTY and CORAL becomes exactly Train Ordinal Model (Proportional Odds) with Loss = AllThreshold and Margin = Logistic, and CORN becomes exactly Train Ordinal Model (Continuation Ratio) — the same objective in the same parameters. The hidden layers are the entire contribution, so if your problem is linear in the features prefer those nodes: convex objective, no seed dependence, readable coefficients, better tested. Reach for this one when the level is genuinely not monotone in the features (a boundary that bends back on itself, which no linear ordinal model can represent at all). Two costs come with the network: it has far more parameters than a linear model and so needs far more rows — check the Architecture output — and the objective is not convex, so the Seed changes the fit. Scale your features first with the Fit Feature Scaler node; unscaled columns make this converge slowly or not at all.

fit_ordinal_neuralml
Inputs11
Outputs5
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.
4/10Medium
GovernancePolicy, audit, or compliance impact.
3/10Low
ReliabilityOperational stability considerations.
5/10Medium
CostExternal or compute cost impact.
4/10Medium

Input Pins

11

Input

Execution
exec_in

Execution trigger that begins neural ordinal model training

Data Source

String
source

Choose which backend supplies the training data

Default Database
Database

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 training fails rather than guessing one. Note that a declared level the training data never reaches is fine for CORAL but rejected by CORN, whose task for that level would have no rows to fit.

Head

String
head

Which rank-consistent head sits on the network. Coral shares ONE latent score across every cut point and lets the cut points differ only by an ordered bias, so a row's whole position on the scale is a single number: fewer parameters, lower variance, and the right choice when the levels really are separated by one underlying quantity or when the top levels are thin. Corn instead asks each step conditionally — given the row reached this level, does it go further? — and gives every step its own weights on the shared representation, which suits a target that is a genuine sequential process (escalation tiers, disease stages, how far a funnel got). Its price is data: step k trains only on the rows that reached level k, so the higher steps rest on the fewest rows, and Corn refuses outright to fit a declared level that nothing reaches.

Default Coral
CoralCorn

Hidden Layers

String
hidden_layers

Comma-separated hidden layer widths from the input side, e.g. `16, 8` for two layers. This is the ONLY thing this node adds over the linear ordinal trainers: an EMPTY value collapses the model to its linear equivalent exactly — Coral becomes the All-Threshold proportional-odds fit, Corn becomes the continuation-ratio fit — so if you want an empty value you want one of those simpler, better-tested nodes instead. Wider and deeper buys a boundary that can bend, and costs parameters that have to be paid for in rows: compare the Architecture output's parameter count against your row count. Every width must be at least 1; a zero-width layer would disconnect the head from the features and fit a constant.

Default 16

Activation

String
activation

Non-linearity between the hidden layers. The head itself is always linear, and this has no effect at all when Hidden Layers is empty. Relu is cheap, and its piecewise-linear folds are exactly what let a small network represent a level that is not monotone in the features. Tanh is smooth and bounded, which often trains more gently on small, well-scaled data, but it saturates on large inputs and then passes almost no gradient — one more reason to scale the features first.

Default Relu
ReluTanh

Alpha (L2 Penalty)

Float
alpha

Strength of the L2 penalty on the WEIGHT matrices. Biases and the head's ordering parameters are never penalized: shrinking those would drag the level cut points together and quietly collapse adjacent levels, which changes the model rather than its variance. Raise it when the network memorizes the training rows or the loss blows up; 0 fits unpenalized.

Default 1
Range 0 to 1000

Max Iterations

Integer
max_iterations

Iteration cap for the Adam optimizer; each iteration is one full pass over the training set. Training stops here even if the loss is still falling, which is reported on the Converged pin. A network usually needs noticeably more iterations than the linear ordinal fits.

Default 500
Range 1 to 1000000

Tolerance

Float
tolerance

Relative change in the loss below which training stops. Smaller values fit tighter and cost iterations; 0 always spends the whole iteration budget.

Default 1e-7
Range 0 to 1

Learning Rate

Float
learning_rate

Adam step size. Lower it if the loss oscillates or goes non-finite, raise it if the model has not converged within Max Iterations. A network wants a smaller step than the linear ordinal fits, because a hidden layer compounds every step.

Default 0.05
Range 0.000001 to 10

Seed

Integer
seed

Seed for the weight initialization, which is the only randomness in the fit. The objective is NOT convex, so the seed genuinely changes the model you get and an unlucky one can leave the fit in a poor local optimum: refit with two or three seeds to see whether the result is stable. The same seed, data and hyperparameters reproduce a fit exactly.

Default 42
Range 0 to 4294967295

Output Pins

5

Done

Execution
exec_out

Activated once training completes

Model

Struct
model

Thread-safe handle to the trained neural ordinal model. Predictions come back as your original level labels, and unlike the threshold losses of the proportional-odds node this family always carries per-level probabilities, so the Predict node reports a confidence.

NodeMLModelNodeMLModel1 fields
model_refstringrequired
Schema enforced

Levels

Struct
levels

The level order the model was actually 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 an ordinal model behaves oddly.

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"

Converged

Boolean
converged

False when the optimizer hit Max Iterations before the loss settled. The model is still usable but under-fitted, which on a network is more common than on the linear ordinal fits.

Architecture

Struct
architecture

What was actually built: the head, the activation, the hidden layer widths as fitted, and the total parameter count next to the number of training rows. Read the rows-per-parameter figure before you trust a training score — with fewer rows than parameters the network can reproduce the training labels outright. Empty hidden layers here means the fit was the linear equivalent, and a simpler ordinal node would have done the same job.

OrdinalNeuralArchitectureOrdinalNeuralArchitecture6 fields
headstringrequired

Rank-consistent head that was fitted, `Coral` or `Corn`

activationstringrequired

Non-linearity between the hidden layers. Reported even with no hidden layer, where it never took effect.

hidden_layersArray<integer:uint>required

Hidden layer widths as fitted, input side first. EMPTY means the backbone was a plain linear map, so this fit was the linear equivalent of a simpler ordinal node.

itemsinteger:uintarray item
format uintmin 0
parameter_countinteger:uintrequired

Every fitted number: all weight matrices, all bias vectors, and CORAL's `K - 1` ordering parameters.

format uintmin 0
training_samplesinteger:uintrequired

Rows the model was fitted on

format uintmin 0
samples_per_parameternumber:doublerequired

`training_samples / parameter_count`. Below 1 the network has enough freedom to memorize the training set, which makes a training score meaningless.

format double

Node Info

Internal name
fit_ordinal_neural
Category
AI/ML/Ordinal
Version
1