# Update predictive scoring model (legacy)

Update a predictive scoring model. <br> *This endpoint is for Audience Studio legacy. For the latest Audience Studio, contact your Customer Success Representative.*

Endpoint: PATCH /audiences/{audienceId}/predictive_segments/{predictiveSegmentId}
Version: 1.0.0
Security: TdApikeyAuth

## Path parameters:

  - `audienceId` (integer, required)
    Master Segment id of the predictive segment

  - `predictiveSegmentId` (integer, required)

## Request fields (application/json):

  - `name` (string)

  - `description` (string)

  - `baseSegmentId` (integer)

  - `segmentId` (integer)

  - `scoredSegmentId` (integer)

  - `gradeThresholds` (array)
    Given the items [a, b, c], they must meet the condition `a >= b >= c`
    Example: [75,50,25]

  - `categoricalAsColumnNames` (array)

  - `categoricalArrayAsColumnNames` (array)

  - `quantitativeAsColumnNames` (array)

  - `preprocess` (array)
    Definition of preprocess. All of `$item.column` must be specified in one of categoricalAsColumnNames, categoricalArrayAsColumnNames, or quantitativeAsColumnNames.

  - `preprocess.column` (string, required)

  - `preprocess.source` (object, required)

  - `preprocess.source.column` (string)

  - `preprocess.source.table` (string)

  - `preprocess.source.functions` (array)

  - `preprocess.source.functions.function` (string, required)
    Enum: "+", "-", "*", "/"

  - `preprocess.source.functions.arg` (number)

  - `preprocess.source.functions.search` (string)

  - `preprocess.source.functions.replacement` (string)

  - `preprocess.source.functions.start` (number)

  - `preprocess.source.functions.length` (number)

  - `preprocess.source.functions.pattern` (string)

  - `preprocess.source.functions.group` (number)

  - `preprocess.source.functions.default` (number, required)

  - `preprocess.source.functions.op` (string)
    Enum: ">", "<", "<=", ">=", "=", "!=", "is", "is\\", "not"

  - `preprocess.source.functions.right_value` (number)

  - `preprocess.source.functions.then` (number)

  - `preprocess.source.functions.else` (number)

## Response 200 fields (application/json):

  - `audienceId` (string)

  - `id` (string)

  - `baseSegmentId` (string)

  - `segmentId` (string)

  - `scoredSegmentId` (string)

  - `name` (string)

  - `description` (string)

  - `categoricalAsColumnNames` (array)

  - `categoricalArrayAsColumnNames` (array)

  - `quantitativeAsColumnNames` (array)

  - `accuracy` (number)
    Accuracy for trained model evaluated on initial training.

  - `areaUnderRocCurve` (number)
    Evaluation score for the model. See also https://en.wikipedia.org/wiki/Receiver_operating_characteristic#Area_under_the_curve

  - `gradeThresholds` (array)
    Given the items [a, b, c], they must meet the condition `a >= b >= c`
    Example: [75,50,25]

  - `createdAt` (string)

  - `updatedAt` (string)

## Response 400 fields (application/json):

  - `code` (string, required)

  - `message` (string, required)

## Response 401 fields (application/json):

  - `code` (string, required)

  - `message` (string, required)

## Response 403 fields (application/json):

  - `code` (string, required)

  - `message` (string, required)

## Response 404 fields (application/json):

  - `code` (string, required)

  - `message` (string, required)

## Response 4XX fields (application/json):

  - `code` (string, required)

  - `message` (string, required)

## Response 5XX fields (application/json):

  - `status` (integer, required)
    Error status

  - `error` (string, required)
    Error message

  - `details` (string)
    Detailed error message

