Skip to main content
Open llms.txtCopy tools

Parameters

This page explains the training controls on CartoBoostRegressor and how they change fitting behavior. Start with defaults, establish a validation split, and tune only parameters that correspond to the structure in your data.

Choose Parameters From The Data

Before tuning ranges, decide what claim the model needs to support. In structured regression work, parameters should usually map to a modeling question:

Scientific questionControls to consider
Is a dense tabular baseline enough for fare, duration, demand, or residual prediction?split_policy=SplitPolicy.AXIS_ONLY
Are pickup/dropoff coordinates or projected x/y values defining spatial boundaries?SplitPolicy.STRUCTURED plus declared spatial-pair schema entries
Does hour-of-day, weekday, or season wrap around?SplitPolicy.STRUCTURED plus declared periodic schema entries
Are rare memberships, routes, cells, or service-area memberships part of the signal?SplitPolicy.STRUCTURED plus declared sparse-set schema entries
Should nearby observations blend across an uncertain boundary?fuzzy=True, fuzzy_bandwidth, fuzzy_kernel
Is the target about median-like behavior, outlier resistance, or asymmetric service risk?loss="mae", loss="huber", loss="log_l2", or loss="quantile"
Is a local trend still visible after the tree finds a region or time bucket?leaf_predictor="linear", linear_leaf_features
Does domain knowledge require monotone response to a dense feature?monotonic_constraints

Keep comparisons disciplined: change one family of modeling controls at a time when possible, and compare against an axis-only CartoBoost baseline plus LightGBM or XGBoost under the same split and feature set.

Core Boosting

These parameters control model capacity and shrinkage. They are useful for ordinary bias/variance tuning after the validation split is fixed.

ParameterDefaultNotes
n_estimators100Number of boosting rounds. Must be non-negative.
learning_rate0.05Shrinks each tree contribution. Must be finite and positive.
max_depth4Maximum tree depth. 0 produces a constant model.
min_samples_leaf20Minimum weighted row count per leaf candidate.
min_gain1e-8Minimum gain required to split.
random_stateNoneReserved for deterministic APIs; current training paths are deterministic.
n_threadsNoneNumber of native CPU threads; use it for reproducible scale measurements.

Loss

Choose the loss from the estimand. Mean regression is appropriate for many fare or duration targets, but structured data often contains heavy tails, dispatch exceptions, and localized service-level questions.

ParameterDefaultNotes
loss"l2"Accepts "l2", "squared_error", "l1", "mae", "absolute_error", "huber", "log_l2", "quantile", or "pinball".
quantile_alpha0.5Required to be finite and in (0, 1) for quantile loss.
huber_delta1.0Positive clipping threshold for Huber loss.
log_offset1.0Positive offset for log_l2.

l1, huber, log_l2, and quantile loss currently require leaf_predictor="constant".

Split policy

SplitPolicy is the main CartoBoost structural modeling choice. AUTO lets Rust choose the bounded dense path, AXIS_ONLY keeps the baseline exact, and STRUCTURED derives candidates only from declared schema roles.

PolicyPurpose
SplitPolicy.AUTOBounded native dense search selected from fit shape and objective.
SplitPolicy.AXIS_ONLYStandard one-feature threshold baseline.
SplitPolicy.STRUCTUREDNative candidates derived only from periodic, spatial-pair, and sparse-set schema roles.

Common temporal-spatial policies:

Problem shapeSuggested policy
General tabular baselineSplitPolicy.AUTO
Exact axis baselineSplitPolicy.AXIS_ONLY
Dense location and timeSplitPolicy.STRUCTURED with declared roles
Route or cell membershipSplitPolicy.STRUCTURED with periodic and sparse roles
Location plus sparse membershipsSplitPolicy.STRUCTURED with spatial-pair and sparse roles

Leaves

ParameterDefaultNotes
leaf_predictor"constant"Accepts "constant" or "linear".
linear_leaf_featuresNonePython API currently expects stringified integer feature indices, such as ["0", "2"].
l2_regularization1.0Ridge penalty for linear leaves.

Use linear leaves when the tree can find a region or time bucket but the remaining residual trend inside that region is still approximately linear. For example, a learned corridor may still have a distance or time-of-day trend represented locally rather than globally.

Fuzzy Routing

ParameterDefaultNotes
fuzzyFalseEnables fractional branch assignment during training and weighted prediction recursion.
fuzzy_bandwidth0.0Split transition bandwidth. Must be finite and non-negative.
fuzzy_kernel"linear"Transition shape. Accepts "linear", "gaussian", "exponential", "bisquare", "epanechnikov", or "tricube".

Fuzzy routing is not compatible with monotonic constraints.

Use fuzzy routing for temporal-spatial features where nearby values should not change abruptly at a learned boundary. This is especially relevant when zone edges, corridor definitions, pickup coordinates, or service areas are noisy measurements of a continuous process. Set fuzzy_bandwidth in the same units as the feature values, such as projected coordinate units or hours. Use fuzzy_kernel="linear" for simple piecewise interpolation, "gaussian" or "tricube" for smoother transitions, and compact-support kernels like "bisquare" or "epanechnikov" when you want the blend to drop off faster near the edge of the band.

Monotonic Constraints

monotonic_constraints is a list of -1, 0, or 1 values with one entry per dense feature:

  • 1 requires predictions to be non-decreasing in that feature.
  • -1 requires predictions to be non-increasing in that feature.
  • 0 leaves the feature unconstrained.

Current constraints require constant leaves, non-fuzzy training, and axis-style split policy. Use SplitPolicy.STRUCTURED when the scientific design requires directional behavior, such as non-decreasing fare with distance after accounting for the rest of the feature set, and document that constraint in the model artifact or report.