Skip to content

Train Ordinal Model (Continuation Ratio) Node

AI/ML/Ordinal

Fit/Train a continuation-ratio model on an ORDERED target that is really a process that can halt. It fits K-1 sub-models, where sub-model k answers `given this row reached level k, did it STOP there?`, so the model describes a progression through the levels instead of placing cut points on a latent scale. Reach for it when the levels are genuinely sequential and each one had to be passed to get to the next: escalation tiers, disease stages, how far a signup funnel got, how far an incident escalated before it was contained. Each sub-model carries its own coefficient vector, so nothing assumes proportional odds, and the per-level probabilities are exact by the chain rule rather than differences of two fits. The cost is strictness: because each sub-model is conditioned on having reached its level, EVERY level must occur in the training data, middle ones included. Scale your features first with the Fit Feature Scaler node: these are gradient fits, and unscaled columns make them converge slowly or not at all.

fit_ordinal_continuation_ratioml
Inputs8
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.
6/10Medium
GovernancePolicy, audit, or compliance impact.
7/10High
ReliabilityOperational stability considerations.
6/10Medium
CostExternal or compute cost impact.
6/10Medium

Input Pins

8

Input

Execution
exec_in

Execution trigger that begins 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. Unlike the other ordinal nodes, a level you list here that never occurs in the data is rejected instead of merely left unpredicted: its sub-model would have no rows to separate.

Link Function

String
link

The CDF each conditional stopping probability is read through. CLogLog is the standout pairing here: with it this model IS the discrete-time proportional-hazards (grouped survival) model, each sub-model's output is the hazard of stopping at that step, and a shared feature effect multiplies every hazard by the same factor — so for `how long / how far until something stopped` targets, pick CLogLog and read the fit as a survival model. Logit gives conditional log-odds, the classical continuation-ratio logit, and is the safe default. Probit assumes a normal latent variable per step. Cauchit is heavy-tailed, so extreme rows pull each sub-model far less.

Default Logit
LogitProbitCLogLogCauchit

Alpha (L2 Penalty)

Float
alpha

Strength of the L2 penalty on each sub-model's coefficients; the intercepts are never penalized. Because the penalty is a fixed amount added to a summed log-likelihood, one value shrinks the high levels harder than the low ones — which is what you want, since those are the sub-models fitted on the fewest rows. Raise it when Subset Sizes shows a thin top end.

Default 1
Range 0 to 1000

Max Iterations

Integer
max_iterations

Iteration cap for the Adam optimizer, applied to EACH sub-model separately. A single sub-model stopping here makes Converged false.

Default 500
Range 1 to 1000000

Tolerance

Float
tolerance

Relative change in a sub-model's objective below which its fit stops. The test is relative, so it means the same thing on the large bottom subset and the small top one. 0 always runs the full iteration budget.

Default 1e-7
Range 0 to 1

Learning Rate

Float
learning_rate

Adam step size, shared by every sub-model. Lower it if training oscillates or produces non-finite values; raise it if the model has not converged within Max Iterations.

Default 0.1
Range 0.000001 to 10

Output Pins

5

Done

Execution
exec_out

Activated once training completes

Model

Struct
model

Thread-safe handle to the trained continuation-ratio model. Predictions come back as your original level labels, and the per-level probabilities behind them sum to exactly 1 because the chain rule telescopes.

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"

Subset Sizes

Integer Array
subset_sizes

How many training rows each sub-model actually saw, lowest level first: entry k counts the rows that reached level k. It only ever decreases, so the LAST entry is the evidence behind your top level — the honest measure of how much to trust the high end of the fit. A small tail there means the top coefficients are noise, not a subtle effect.

Converged

Boolean
converged

True only when EVERY sub-model's objective settled before Max Iterations. One stubborn sub-model — usually the top one, fitted on the fewest rows — makes it false; the run log names which levels stalled.

Node Info

Internal name
fit_ordinal_continuation_ratio
Category
AI/ML/Ordinal
Version
1