Configuration
This page covers the runtime configuration options for KumoRFM, including run modes, temporal behavior, inference behavior, batch prediction, and retry handling.
Run Modes
The run_mode parameter controls the trade-off between prediction quality and speed by adjusting how much context data is sampled.
For forecasting tasks, when an entity has more historical rows than the Context Size cap, KumoRFM uses the most recent N rows (not the oldest). This ensures forecasts reflect the latest data patterns.
You can also fine-tune the neighbor sampling directly:
Temporal and Context Timing
Use these parameters in KumoRFM.predict() and KumoRFM.evaluate() when you need to control the prediction timestamp or the historical examples used as model context.
For example, set anchor_time when you want to predict as of a specific point in time:
Use context_anchor_time when the prediction date and the latest available context data should differ:
Set lag_timesteps when recent historical target values should be available to the model as additional context. For example, lag_timesteps=3 adds the previous three target windows as lagged features:
Inference Configuration
The inference_config parameter controls inference-time model behavior, including ensembling. You can pass either a dictionary or a configuration object from kumoapi.rfm.
When you pass a dictionary, KumoRFM casts it based on the task type:
- Classification tasks use
ClassificationInferenceConfig. - Regression and forecasting tasks use
RegressionInferenceConfig.
If you omit inference_config, KumoRFM selects defaults automatically based on the task type.
Common options:
Classification option:
Regression and forecasting options:
When output_type="quantiles", the prediction output contains 27 quantile columns instead of a single TARGET_PRED column:
Classification example:
Regression example:
Output and Collection Controls
These options control what predict() returns and how KumoRFM collects valid context labels.
Batch Mode
For predictions over many entities, use KumoRFM.batch_mode() to automatically split the workload into batches:
Parameters:
batch_size: The number of entities per batch. Set to"max"(default) to use the maximum applicable batch size for the task type.num_retries: Number of retries for failed batches due to server issues.
The maximum prediction sizes per task type are:
Retry
Use KumoRFM.retry() to automatically retry failed queries due to transient server issues:
This is useful for long-running batch predictions where occasional failures are expected.
Size Limits
KumoRFM enforces a 30 MB context size limit per prediction. If exceeded, you will see an error message suggesting:
- Reducing the number of tables in the graph
- Reducing the number of columns (e.g., large text columns)
- Adjusting the neighborhood configuration
- Using a lower run mode
The optimize parameter in KumoRFM can help with database backends by creating indices for faster sampling: