Skip to content

Train Classifier (Random Forest) Node

AI/ML/Classification

Fit/Train a Random Forest classifier: many Decision Trees, each grown on a bootstrapped sample of the rows and a random subset of the features, combined by majority vote. Far more robust to overfitting than a single tree, at the price of interpretability. Model size and fit time grow linearly with Ensemble Size, so a forest of 500 trees costs roughly 500x a single tree.

fit_random_forestml
Inputs8
Outputs2
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.
8/10High
CostExternal or compute cost impact.
5/10Medium

Input Pins

8

Input

Execution
exec_in

Execution trigger that begins Random Forest training

Data Source

String
source

Choose which backend supplies the training data

Default Database
Database

Ensemble Size

Integer
ensemble_size

Number of Decision Trees to grow. Both fit time and the size of the saved model scale linearly with this value.

Default 100
Range 1 to 2000

Bootstrap Proportion

Float
bootstrap_proportion

Share of the training rows drawn (with replacement) for each tree. Must be greater than 0 and at most 1.

Default 0.7
Range 0 to 1

Feature Proportion

Float
feature_proportion

Share of the features offered to each tree. Must be at most 1. Leave at 0 for the textbook default of sqrt(feature count) features per tree.

Default 0
Range 0 to 1

Max Depth

Integer
max_depth

Maximum depth of each tree. 0 or less means unlimited, which grows deeper trees and a larger model.

Default 10

Min Samples Split

Float
min_weight_split

Minimum summed sample weight a node needs before it may be split. Without row weights this is simply the minimum number of samples.

Default 2
Range 1 to 100000

Seed

Integer
seed

Seed for the bootstrap and feature sampling. Fixing it makes the row and feature draws reproducible. Note that the base trees are not bit-exact across processes: linfa resolves modal-class ties in hash-map iteration order, which Rust re-randomizes on every run.

Default 42
Range 0 to 4294967295

Output Pins

2

Done

Execution
exec_out

Activated once training completes

Model

Struct
model

Thread-safe handle to the trained Random Forest classifier

NodeMLModelNodeMLModel1 fields
model_refstringrequired
Schema enforced

Node Info

Internal name
fit_random_forest
Category
AI/ML/Classification