<div class="section-label"><span class="num">07</span> Prediction Options</div> <div class="section-title">v2 option classes for the Python <em>client</em>.</div> These classes configure `predict_psr`, `predict_maxfit`, and `predict_grid`. They map onto the extended OpenAPI body, not the local engine’s [[Settings/Options|Settings]] names. Unused fields on a given model are ignored. ```python from csa_common_lib.classes.prediction_options import ( PredictionOptions, MaxFitOptions, GridOptions, ) ``` ## PredictionOptions Base options for PSR, and the parent of MaxFit and Grid. | Name | Type | Default | Description | | --- | --- | --- | --- | | <span class="mono">threshold</span> | float or ndarray, 1 × T | <span class="mono">None</span> | Censor cut(s). If omitted, PSR evaluates <span class="mono">[0, 0.90)</span> in 0.10 increments | | <span class="mono">is_threshold_percent</span> | bool | <span class="mono">True</span> | Thresholds in percentile (decimal) units | | <span class="mono">most_eval</span> | bool | <span class="mono">True</span> | <span class="mono">True</span>: score > threshold; <span class="mono">False</span>: score < threshold | | <span class="mono">eval_type</span> | str | <span class="mono">"both"</span> | <span class="mono">relevance</span>, <span class="mono">similarity</span>, or <span class="mono">both</span> | T = number of thresholds. > [!note] > The REST extended spec for PSR says that an omitted threshold evaluates <span class="mono">[0, 0.99)</span> in 0.20 increments. The v2 Python class documents <span class="mono">[0, 0.90)</span> in 0.10 increments. Honor the class when you call the client; honor the OpenAPI body when you POST JSON yourself. ## MaxFitOptions Inherits [[#PredictionOptions|PredictionOptions]] and adds MaxFit defaults. | Name | Type | Default | Description | | --- | --- | --- | --- | | <span class="mono">threshold</span> | float or ndarray, 1 × T | <span class="mono">[0, 0.20, 0.50, 0.80]</span> | Candidate thresholds | | <span class="mono">objective</span> | str | <span class="mono">adjusted_fit</span> | Objective of the MaxFit solver | ## GridOptions Inherits [[#MaxFitOptions|MaxFitOptions]] and adds combination search. | Name | Type | Default | Description | | --- | --- | --- | --- | | <span class="mono">attribute_combi</span> | ndarray, Q × K | <span class="mono">None</span> | Binary rows of variable membership. If omitted, all combinations are evaluated | | <span class="mono">k</span> | float | <span class="mono">1</span> | Lower bound on the number of variables in each combination Q | Q = number of combinations. These JSON field names match the extended spec on [[API/Prediction Engine/Grid#Custom settings|Grid]], [[API/Prediction Engine/MaxFit#Custom settings|MaxFit]], and [[API/Prediction Engine/PSR#Custom settings|PSR]]. ## Related - [[API/Python API Client/Common Lib/Overview|Common Lib]] - [[predict_grid|predict_grid]] · [[predict_maxfit|predict_maxfit]] · [[predict_psr|predict_psr]] - [[Settings/Options|Settings (local engine)]]