> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mathfi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Choose which model predictions run against

> Points this run's predictions at a different one of the models it offers.

- Only an attempt the run actually offers can be chosen. Anything else returns `400`.
- Nothing is rebuilt. A flag moves, so this is cheap and repeatable.
- Changing it never rewrites history. Every prediction records the version it ran against.

To predict with a different model, change it here and run the prediction again.




## OpenAPI

````yaml api-reference/openapi.yaml POST /api/v1/training/{trainingJobKey}/champion
openapi: 3.0.1
info:
  title: MathFi.ai API
  description: >
    The MathFi.ai REST API runs the two products end to end.


    **Feature Refinery** takes your labelled data and works out which columns

    actually carry the signal. It returns a reduced train and test pair, a

    per-column keep/remove decision, and the performance target the refined data

    reached.


    **Model Crucible** takes a dataset, trains every algorithm family against it

    at once, ranks the results on held-out data by fewest wrong decisions, and

    keeps the best three as versions of one model. You pick which one
    predictions

    run against.


    Everything is asynchronous: you create a thing, upload to a signed URL,
    start

    it, then poll until the state is terminal. Nothing streams and nothing
    blocks.
  contact:
    name: MathFi.ai
    url: https://mathfi.ai
    email: support@mathfi.ai
  license:
    name: MathFi.ai
    url: https://mathfi.ai
  version: 1.0.0
servers:
  - url: https://{tenant}-api.mathfi.ai
    description: >-
      Your tenant's API. Each customer has their own, so the host varies.
      Replace {tenant} with the name issued when your tenant was created.
    variables:
      tenant:
        default: your-tenant
        description: The tenant name issued to you.
security:
  - BearerAuth: []
tags:
  - name: Authentication
    description: Exchange credentials for a bearer token
  - name: Feature Refinery
    description: Reduce a dataset to the columns that earn their place
  - name: Datasets
    description: >-
      Prepare labelled data for training, from uploads or from a finished
      refinement
  - name: Training
    description: Run the Crucible against a dataset and choose the champion model
  - name: Models
    description: Trained models and their versions
  - name: Predictions
    description: Score unlabelled data against a champion model
paths:
  /api/v1/training/{trainingJobKey}/champion:
    post:
      tags:
        - Training
      summary: Choose which model predictions run against
      description: >
        Points this run's predictions at a different one of the models it
        offers.


        - Only an attempt the run actually offers can be chosen. Anything else
        returns `400`.

        - Nothing is rebuilt. A flag moves, so this is cheap and repeatable.

        - Changing it never rewrites history. Every prediction records the
        version it ran against.


        To predict with a different model, change it here and run the prediction
        again.
      operationId: selectChampion
      parameters:
        - name: trainingJobKey
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChampionSelectionRequest'
      responses:
        '200':
          description: The choice was applied.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChampionSelectionOutput'
        '400':
          description: That attempt is not one of the models this run offers.
        '401':
          description: Not authenticated.
        '404':
          description: No such training job.
      security:
        - BearerAuth: []
components:
  schemas:
    ChampionSelectionRequest:
      description: Which of the run's models to predict with from now on.
      required:
        - attemptNumber
      type: object
      properties:
        attemptNumber:
          description: >-
            The attempt behind the model you want, as reported on the run's
            candidates.
          type: integer
          example: 7
        observations:
          description: >-
            Why, in your own words. Replaces the reason the run recorded for
            itself.
          type: string
          nullable: true
          example: Higher recall matters more than total error here
    ChampionSelectionOutput:
      description: Which candidate predictions run against, and how that came to be.
      type: object
      properties:
        attemptNumber:
          type: integer
        version:
          type: string
        selectedBy:
          type: string
          enum:
            - AUTOMATIC
            - USER
        observations:
          description: >-
            Why this candidate — the run's own reason, or the user's own words
            over it.
          type: string
          nullable: true
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````