Skip to content

Create predictive scoring model

Request

Create a new predictive scoring model.

Bodyapplication/vnd.treasuredata.v1+json
idstring[1-9][0-9]*
typestring
Value:"predictive-segment"
attributesobject
relationshipsobject
curl -i -X POST \
  https://api-cdp.treasuredata.com/entities/predictive_segments \
  -H 'Content-Type: application/vnd.treasuredata.v1+json' \
  -d '{
    "id": "string",
    "type": "predictive-segment",
    "attributes": {
      "name": "string",
      "description": "string",
      "baseSegmentId": 0,
      "segmentId": 0,
      "scoredSegmentId": 0,
      "gradeThresholds": [
        75,
        50,
        25
      ],
      "categoricalAsColumnNames": [
        "string"
      ],
      "categoricalArrayAsColumnNames": [
        "string"
      ],
      "quantitativeAsColumnNames": [
        "string"
      ],
      "preprocess": [
        {
          "column": "string",
          "source": {
            "column": "string",
            "table": "string",
            "functions": [
              {
                "function": "+",
                "arg": 0
              }
            ]
          }
        }
      ]
    },
    "relationships": {
      "parentFolder": {
        "data": {
          "id": "string",
          "type": "folder-segment"
        }
      }
    }
  }'

Responses

Create a predictive segment

Bodyapplication/vnd.treasuredata.v1+json
dataobject(PredictiveSegmentJsonApiResourceAttr)required
includedArray of objects(UserJsonApiResource)required
Response
{ "data": { "audienceId": "string", "baseSegmentId": "string", "segmentId": "string", "scoredSegmentId": "string", "name": "string", "description": "string", "categoricalAsColumnNames": [], "categoricalArrayAsColumnNames": [], "quantitativeAsColumnNames": [], "accuracy": 100, "areaUnderRocCurve": 1, "gradeThresholds": [], "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "modelUpdatedAt": "2019-08-24T14:15:22Z" }, "included": [ {} ] }