SegmentML

SegmentML Create

Create a new SegmentML model.

Model configuration can be specified either through sending the options as a flat JSON object POST body or through URL parameters on the request.

# Curl example of creating a SegmentML model
curl -s -J -XPOST "https://api.lytics.io/api/segmentml" -H "Authorization: $LIOKEY" -d '
{
    "source": "all",
    "target": "smt_power",
    "use_scores": true
}
'
post/api/segmentml

Request

  • Base URL
    https://api.lytics.io
  • URL
    https://api.lytics.io/api/segmentml
  • Auth
    API key in header Authorization

Query parameters

account_idstring

Your Lytics account ID.

sourcestring required

ID or slug of the source segment.

targetstring

ID or slug of the target segment. Required if target field is not supplied.

use_scoresboolean

Include raw behavioral scores as features in the model (usually very useful).

target_fieldstring

Slug of the target field. Cannot provide both a target and a target field, hence required if target segment is not indicated (see above).

use_contentboolean

If true, include content affinities as features in the model.

aspect_collectionsstring

List of Segment Collections to include in the model. Possible values are "email", "web", "support", "mobile", "commerce", "behaviors", "content".

additional_fieldsstring

List of additional user fields to include in the model.

model_onlyboolean

Build the model without scoring each user. This is useful during model building exercises when comparing efficiency and accuracy between models. Set true by default unless evalonly is selected.

eval_onlyboolean

If true, a previously built model is used to rescore users. Only the source and target parameters are needed in the API call to to identify which model to use.

auto_tuneboolean

If true, enable auto-tune feature selection.

tune_modelboolean

If true, model tuning parameters are optimized before any models are built. Experimental.

tagsstring

Includes tags to be associated with the model.

re_runboolean

If true, re-run the model every week.

save_segmentsboolean

If true, this saves three different segments: 1) Users from source and target segments who "look like" users from the target segment. 2) Users not in the target segment. 3) Users from the source segment who look like users from the target segment.

as_isboolean

If true, do not remove any of the model features when creating the model.

num_to_trainnumber

The number of samples to collect from both the source and target segment for feature matrices. Defaults to 5,000.

cor_thresholdnumber

Threshold (0.0-1.0) at which to remove correlated features.

Response

Created

namestring
statestring
reasonstring
createdstring

Example response

{
  "name": "test_rf",
  "state": "building",
  "reason": "",
  "created": "2018-07-10T16:10:54.456003352-07:00",
  "conf": {
    "source": {
      "aid": 123,
      "account_id": "lol",
      "id": "",
      "name": "all",
      "is_public": false,
      "slug_name": "",
      "description": "",
      "author_id": "",
      "updated": "0001-01-01T00:00:00Z",
      "created": "2018-07-10T16:10:54.442558895-07:00",
      "invalid": false,
      "invalid_reason": "",
      "deleted": false,
      "datemath_calc": false,
      "forward_datemath": false,
      "save_hist": false,
      "schedule_exit": false,
      "tags": null
    },
    "target": {
      "aid": 123,
      "account_id": "lol",
      "id": "",
      "name": "goal",
      "is_public": false,
      "slug_name": "",
      "description": "",
      "author_id": "",
      "updated": "0001-01-01T00:00:00Z",
      "created": "2018-07-10T16:10:54.442559277-07:00",
      "invalid": false,
      "invalid_reason": "",
      "deleted": false,
      "datemath_calc": false,
      "forward_datemath": false,
      "save_hist": false,
      "schedule_exit": false,
      "tags": null
    },
    "target_field": null,
    "model_name": "",
    "additional": null,
    "collections": null,
    "collect": 0,
    "use_scores": true,
    "use_content": false,
    "build_only": false,
    "auto_tune": false
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.