<div class="section-label"><span class="num">04</span> MaxFit</div> <div class="section-title">Search thresholds for the strongest <em>fit</em>.</div> MaxFit keeps a **fixed** attribute set and searches candidate thresholds (optionally both relevance and similarity censoring), then returns the single winning prediction. You choose the objective (fit, adjusted fit, or k-fit); the engine does the search. It is a useful building block when you want threshold selection without a full attribute grid. For primary analysis, prefer [[Grid Prediction]], which diversifies across attribute combinations *and* thresholds, then blends by fit. <p>&nbsp;</p> ## When to use MaxFit - You want the engine to **pick** the threshold on one attribute set - You may want to compare relevance and similarity censoring in one call - You care about an explicit objective: <span class="mono">fit</span>, <span class="mono">adjusted_fit</span>, or <span class="mono">kfit</span> > [!tip] > Need attribute combinations, a fit-weighted composite, and variable impact measures? That is [[Grid Prediction]], the recommended default. MaxFit is the right tool for threshold-focused work on a set you already chose. > [!note] > Fixed thresholds you already know → [[Predict]]. Exploring many attribute subsets → [[Grid Prediction]]. ## What you call ```text predict_maxfit( y, # outcomes, length N X, # attributes, N × K theta, # circumstances, length K options? # optional; omit → defaults ) → prediction results ``` Same data shape as [[Predict]]. ## Settings that matter **MaxFit-only** | Setting | Meaning | Default | | --- | --- | --- | | <span class="mono">objective</span> | Score used to pick the winner | <span class="mono">kfit</span> | | <span class="mono">inner_parallel</span> | Speed up searching both censor types | <span class="mono">auto</span> | **Shared settings** (see [[Config/Options#MaxFitOptions|MaxFitOptions]]) - Default thresholds: <span class="mono">[0, 0.2, 0.5, 0.8]</span> - Default censor type: <span class="mono">both</span> (allowed here; not on Predict) - Plus the usual censor unit / operator, scale, and flags ## What you get back **PredictionResults** for the **winning** threshold: typically one prediction, not a combination grid. - Root fields such as <span class="mono">yhat</span> and <span class="mono">fit</span> reflect the winner ([[Results/Core|Core]]) - <span class="mono">maxfit_index</span> (when present) marks which candidates were in the original search - Nested groups (<span class="mono">prediction_weights</span>, <span class="mono">insights</span>, <span class="mono">auxiliary</span>, <span class="mono">solo_distribution</span>) follow the same pattern as Predict for the retained result <div class="btn-row center"> <a class="btn-primary" href="/Functions/Grid%20Prediction">Prefer Grid Prediction</a> <a class="btn-ghost" href="/Config/Options#MaxFitOptions">MaxFitOptions</a> </div> ## Related - [[Grid Prediction]]: primary analysis path (recommended) - [[Predict]]: single evaluation at given thresholds - [[Results/Overview|Results]]: how to read the winning result