Skip to content

Train Ordinal Model (Frank & Hall) Node

AI/ML/Ordinal

Fit/Train an ordinal model by decomposition: the ordered target is cut K-1 times (`is the level above this cut?`) and each cut is handed to an ordinary binary classifier, with the predicted level read back as the number of cuts answered yes. This is the one ordinal trainer here that is not linear in the features, so reach for it when the boundary between levels bends in a way the Proportional Odds and Ridge trainers cannot follow. The price is that the K-1 sub-models are fitted independently: there is no single latent scale, no coefficient vector to read a direction off, and no calibrated per-level probabilities - use Proportional Odds when you need those. Every declared level must occur in the training data at the bottom and at the top of the ordering, otherwise a cut has only one class and cannot be fitted. A Random Forest base is the sturdiest choice and by far the costliest: each cut grows its own full forest, so training costs K-1 forests and the saved model carries every tree of every one of them.

fit_ordinal_frank_hallml
Inputs4
Outputs3
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.
5/10Medium
GovernancePolicy, audit, or compliance impact.
5/10Medium
ReliabilityOperational stability considerations.
6/10Medium
CostExternal or compute cost impact.
5/10Medium

Input Pins

4

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. Listing a level that never occurs at either end of the ordering makes its cut unfittable and is rejected.

Base Learner

String
base_learner

Which binary classifier is fitted for each of the K-1 cuts. Decision Tree follows non-linear, non-monotone boundaries and needs no feature scaling, at the cost of overfitting when left deep. Gaussian Naive Bayes is far cheaper and stays stable when rows are few relative to columns, but assumes the features are independent and roughly normal on each side of a cut. Random Forest bags many trees per cut and averages away most of a single tree's variance, usually making it the strongest option here - but it fits one entire forest per cut, so both the training time and the size of the saved model are multiplied by K-1.

Default Decision Tree
Decision TreeGaussian Naive BayesRandom Forest

Output Pins

3

Done

Execution
exec_out

Activated once training completes

Model

Struct
model

Thread-safe handle to the trained decomposition. Predictions come back as your original level labels.

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"

Node Info

Internal name
fit_ordinal_frank_hall
Category
AI/ML/Ordinal
Version
2