Skip to content

Train Ordinal Model (Ridge) Node

AI/ML/Ordinal

Fit/Train an ordinal model the cheap way: ridge-regress the level rank on the features, then cut the score at thresholds learned from the training distribution instead of rounding it. Closed-form, so it stays fast exactly where the proportional-odds model gets expensive - many levels, many features, or when you just want a quick ordinal baseline to beat. It also degrades gracefully when the proportional-odds assumption does not hold. Unlike the proportional-odds model it yields no probabilities: you get the predicted level and the latent score behind it, nothing calibrated.

fit_ordinal_ridgeml
Inputs4
Outputs4
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.
7/10High
GovernancePolicy, audit, or compliance impact.
8/10High
ReliabilityOperational stability considerations.
8/10High
CostExternal or compute cost impact.
8/10High

Input Pins

4

Input

Execution
exec_in

Execution trigger that begins ordinal ridge training

Data Source

String
source

Choose which backend supplies the training data

Default Database
Database

Class Order

String
class_order

Level labels from LOWEST to HIGHEST, comma separated - e.g. `low, medium, high`. Leave empty when the levels are numeric and their numeric order is already the one you want (`1, 2, 10` sorts as numbers, not as text). Non-numeric labels carry no inferable order, so training fails rather than guessing unless you list them here.

Alpha (L2 Penalty)

Float
alpha

Strength of the L2 penalty. Must be strictly greater than 0: the penalty is added to the diagonal of the normal equations and is the only thing keeping them positive definite, so the Cholesky solve has a unique answer even with collinear or wide features. Larger values shrink the coefficients harder.

Default 1

Output Pins

4

Done

Execution
exec_out

Activated once training completes

Model

Struct
model

Thread-safe handle to the trained ordinal ridge model. Predictions come back as the original level labels.

NodeMLModelNodeMLModel1 fields
model_refstringrequired
Schema enforced

Levels

Struct
levels

The resolved level order the model was trained on, lowest first, plus whether that order came from `Class Order` or from reading the labels as numbers. Check it before trusting the model - a wrong order trains a wrong model without ever failing.

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"

Coefficients

Struct
coefficients

Fitted coefficients and intercept on the rank scale. The SIGN tells you which way a feature pushes the level: positive moves samples toward the higher levels, negative toward the lower ones. The magnitude is only comparable across features when they share a scale.

LinearCoefficientsLinearCoefficients3 fields
coefficientsArray<number:double>required

Feature coefficients (one per input dimension)

itemsnumber:doublearray item
format double
interceptnumber:doublerequired

The y-intercept (bias term)

format double
n_featuresinteger:uintrequired

Number of input features

format uintmin 0

Node Info

Internal name
fit_ordinal_ridge
Category
AI/ML/Ordinal
Version
1