<div class="section-label"><span class="num">02</span> Options</div> <div class="section-title"><em>Settings</em> for each prediction call.</div> These are **advanced knobs**. For general analysis, call <span class="mono">predict</span>, <span class="mono">predict_maxfit</span>, or <span class="mono">predict_grid</span> without the options argument; each method uses suitable defaults. To customize a run, pass the matching object: [[#PredictOptions|PredictOptions]] with <span class="mono">predict</span>, [[#MaxFitOptions|MaxFitOptions]] with <span class="mono">predict_maxfit</span>, or [[#GridOptions|GridOptions]] with <span class="mono">predict_grid</span>. MaxFitOptions and GridOptions **extend** PredictOptions: the same shared fields, with respective relevant options key-values. > [!warning]- C ABI / native integrators > Option names, defaults, and retain knobs here follow the thin clients. The C ABI may expose different symbols, flag names, or ownership rules. Integration engineers should pin and follow the public header contract rather than this chapter alone: [[Install/Native Runtime|Native Runtime]] · [C ABI on GitHub](https://github.com/CambridgeSportsAnalytics/rbp-math-c-abi). ```mermaid classDiagram direction TB class PredictOptions { shared base fields } class MaxFitOptions { +objective +inner_parallel } class GridOptions { +max_iter +k +seed +attribute_combi +retain_grid_objects +inner_parallel } PredictOptions <|-- MaxFitOptions PredictOptions <|-- GridOptions ``` ## PredictOptions Settings for <span class="mono">predict</span>. Also the shared base inherited by MaxFitOptions and GridOptions. **Call:** `predict` **Type:** `PredictOptions` **Defaults when omitted:** threshold `[0.5]`; `censor_type` `relevance`; `censor_unit` `percent`; `censor_operator` `greater_than` ```text PredictOptions ├── threshold ├── censor_type, censor_unit, censor_operator ├── prediction_scale ├── adj_fit_multiplier, inv_method └── verify_missing_data, include_linear_regression, verbose ``` Field details: | Name | Type / values | Default | Description | | --- | --- | --- | --- | | <span class="mono">threshold</span> | vector, length ≥ 1 | <span class="mono">[0.5]</span> | Censor cut(s); becomes T on results | | <span class="mono">censor_type</span> | <span class="mono">relevance</span> \| <span class="mono">similarity</span> | <span class="mono">relevance</span> | Score that is thresholded. <span class="mono">both</span> is invalid here | | <span class="mono">censor_unit</span> | <span class="mono">score</span> \| <span class="mono">percent</span> | <span class="mono">percent</span> | Raw score vs percentile | | <span class="mono">censor_operator</span> | <span class="mono">gt</span> \| <span class="mono">lt</span> \| <span class="mono">gte</span> \| <span class="mono">lte</span> | <span class="mono">gt</span> | How the cut compares to the score | | <span class="mono">prediction_scale</span> | <span class="mono">response</span> \| <span class="mono">logistic</span> | <span class="mono">response</span> | Prediction on y scale or logistic scale | | <span class="mono">adj_fit_multiplier</span> | <span class="mono">identity</span> \| <span class="mono">K</span> \| <span class="mono">log</span> | <span class="mono">K</span> | How adjusted fit is scaled | | <span class="mono">inv_method</span> | <span class="mono">gaussian</span> \| <span class="mono">cholesky</span> \| <span class="mono">pseudoinverse</span> | <span class="mono">gaussian</span> | Covariance inversion method | | <span class="mono">verify_missing_data</span> | on / off | off | Extra missing-data checks | | <span class="mono">include_linear_regression</span> | on / off | off | Attach optional <span class="mono">yhat_linear</span> when available | | <span class="mono">verbose</span> | on / off | off | Diagnostic status messages | > [!note]- Percentile algorithm > When <span class="mono">censor_unit</span> is <span class="mono">percent</span>, a process-wide percentile algorithm also applies (<span class="mono">full_sort</span> or <span class="mono">order_statistics</span>). It is not a field on the options object. See [[Config/Allowed Values#Percentile algorithm|Allowed values]]. ## MaxFitOptions Settings for <span class="mono">predict_maxfit</span>. Includes all [[#PredictOptions|PredictOptions]] fields, with MaxFit-oriented defaults for threshold and censor type. **Call:** `predict_maxfit` **Type:** `MaxFitOptions` **Inherits:** [[#PredictOptions|PredictOptions]] ```text MaxFitOptions ├── …PredictOptions ├── threshold, censor_type (MaxFit defaults) ├── objective └── inner_parallel ``` Field details (MaxFit-specific and overridden defaults): | Name | Type / values | Default | Description | | --- | --- | --- | --- | | <span class="mono">threshold</span> | vector, length ≥ 1 | <span class="mono">[0, 0.2, 0.5, 0.8]</span> | Candidate thresholds to search | | <span class="mono">censor_type</span> | <span class="mono">relevance</span> \| <span class="mono">similarity</span> \| <span class="mono">both</span> | <span class="mono">both</span> | <span class="mono">both</span> allowed (unlike Predict) | | <span class="mono">objective</span> | <span class="mono">fit</span> \| <span class="mono">adjusted_fit</span> \| <span class="mono">kfit</span> | <span class="mono">kfit</span> | Score used to pick the winning threshold | | <span class="mono">inner_parallel</span> | <span class="mono">auto</span> \| <span class="mono">off</span> | <span class="mono">auto</span> | Within-call parallel when searching both censor types | Other PredictOptions fields keep the Predict defaults unless you override them. ## GridOptions Settings for <span class="mono">predict_grid</span>. Includes all [[#PredictOptions|PredictOptions]] fields, with Grid-oriented defaults for threshold and censor type. **Call:** `predict_grid` **Type:** `GridOptions` **Inherits:** [[#PredictOptions|PredictOptions]] ```text GridOptions ├── …PredictOptions ├── threshold, censor_type (Grid defaults) ├── max_iter, k, seed ├── attribute_combi ├── retain_grid_objects │ ├── yhat_cells, adjusted_fit_cells, n_cells, weights_cells │ ├── k_cells, combi_cells │ └── ysolo_distribution └── inner_parallel ``` Field details (Grid-specific and overridden defaults): | Name | Type / values | Default | Description | | --- | --- | --- | --- | | <span class="mono">threshold</span> | vector, length ≥ 1 | <span class="mono">[0, 0.2, 0.5, 0.8]</span> | Thresholds used inside each cell | | <span class="mono">censor_type</span> | <span class="mono">relevance</span> \| <span class="mono">similarity</span> \| <span class="mono">both</span> | <span class="mono">both</span> | <span class="mono">both</span> allowed | | <span class="mono">max_iter</span> | integer > 0 | <span class="mono">1000</span> | Cap on combination search iterations | | <span class="mono">k</span> | integer > 0 | <span class="mono">1</span> | Combination size / sampling parameter | | <span class="mono">seed</span> | unsigned integer | <span class="mono">42</span> | RNG seed for combination sampling | | <span class="mono">attribute_combi</span> | matrix Q × K | generated | Fixed combination matrix; omit to sample | | <span class="mono">retain_grid_objects</span> | omit \| comma-separated keys | omit (lean) | Which per-cell objects to keep (see below) | | <span class="mono">inner_parallel</span> | <span class="mono">auto</span> \| <span class="mono">off</span> | <span class="mono">auto</span> | Parallel over attribute combinations | Other PredictOptions fields keep the Predict defaults unless you override them. ### Retain grid objects Set <span class="mono">retain_grid_objects</span> on <span class="mono">GridOptions</span> to the specific keys you need. Omit it (the default) for a lean composite. Name only the objects you intend to inspect; that keeps memory intentional. Controls which per-combination payloads appear on [[Results/Grid Cells|Grid Cells]]. **Impact on Fit**, **Impact on Prediction**, and other [[Results/Grid Insights|Grid Insights]] do **not** require retain. | Key | Unlocks | Typical shape | | --- | --- | --- | | <span class="mono">yhat_cells</span> | Per-censor cell predictions | Q × T | | <span class="mono">adjusted_fit_cells</span> | Per-censor cell adjusted fit | Q × T | | <span class="mono">n_cells</span> | Per-censor cell counts | Q × T | | <span class="mono">weights_cells</span> | Per-censor cell observation weights | 3-D ≈ (N, T, Q) | | <span class="mono">k_cells</span> | Shared per-combination k-related values | Q × T | | <span class="mono">combi_cells</span> | Shared combination membership / design | Q × K | | <span class="mono">ysolo_distribution</span> | Pooled solo histogram on [[Results/Solo Distribution\|Solo Distribution]] | histogram | Example: <span class="mono">retain_grid_objects="yhat_cells,k_cells,combi_cells"</span> <span class="mono">ysolo_distribution</span> is not the same as <span class="mono">ysolo_cells</span> (N × Q), which may appear with related cell retention. Shapes and nesting: [[Results/Grid Cells|Grid Cells]]. <div class="btn-row"> <a class="btn-primary" href="/Config/Allowed%20Values">Allowed values</a> <a class="btn-ghost" href="/Results/Grid%20Cells">Grid Cells</a> </div> ## Related - [[Predict]] · [[MaxFit]] · [[Grid Prediction]] - [[Config/Allowed Values|Allowed values]] - [[Results/Overview|Results]]