SegmentML
SegmentML provides a framework for building custom machine learning
models directly in Lytics. Lytics SegmentML models are self-training,
continuously-updating and real-time.
SegmentML models are built by identifying:
1. A segment of users, called the **Target Segment** who exhibit behavior for *prediction*,
2. A segment of users, called the **Source Segment** to be candidates for model *evaluation*, or scoring.
Models are built with a variety of pre-selected candidate features, which include behavioral scores and content affinities, and can additionally support any custom field available in Lytics user profiles.
Attributes concerning the SegmentML model's setup configuration are detailed in **SegmentML Create**. Attributes concerning the model's results are defined in **SegmentML Model Fetch**.
Generic attributes from SegmentML model GET and POST:
| field | DataType | Description |
|-------------- |------------------|---------------|
| name | string | The model's name
| state | string | The state of the model: Either *building*, *invalid*, or *complete*
| reason | string | If the state is *invalid* the reason will denote the error
| created | string | Date and time the model was created
SegmentML Model Fetch
https://api.lytics.io/api/segmentml/{id}Get a SegmentML model.
Additional atttributes from a completed SegmentML model GET response:
| field | DataType | Description |
|-----------------------|------------------|---------------|
| features: kind | string | The field is either a Lytics Segment feature (*segment*), a lql/user-field feature (*lql*), a Lytics Behavioral Score feature (*score*), or a Lytics Content Affinity feature (*content*)
| features: fieldtype | string | Field type is either *numeric* or *categorical*
| features: name | string | The name of a field
| features: importance | number | The relative importance of a field in the model
| features: correlation | number | Correlation between specific field and target
| features: impact | object | The impact object details the Lift and shows the marginal effect of a feature on the predicted outcome of the model
| mse | number | Mean-squared error value
| rsq | number | R-squared value or coefficient of determination
| false_negative | number | The number of users in the source segment who are predicted to be in the target segment.
| false_positive | number | The number of users in the target segment who are not predicted to be in the target segment.
| true_negative | number | The number of users in the source segment who are not predicted to be in the target segment.
| true_positive | number | The number of users in the target segment who are predicted to be in the target segment.
| success | []number | Number of successful predictions for a given prediction value
| failure | []number | Number of failed predictions for a given prediction value
| auc | number | Area under the ROC curve
| threshold | number | Optimal decision threshold to minimize false-positives and false-negatives
| accuracy | number | A value that represents the accuracy of the model; scale ranges from 0 (least accurate) to 10 (most accurate).
| reach | number | A value that represents the number of source users that look like target users; scale ranges from 0 (low reach) to 10 (high reach).
| model_health | number | The overall health of the model (i.e. "healthy", "unhealthy")
| msgs | number | Messages for the user about the model with levels of severity (i.e. "debug", "info", "warn", "error")
To learn more about the metrics false negative, false positive etc., check out [binary classification](https://en.wikipedia.org/wiki/Binary_classification).
``
# Curl example of getting a SegmentML model
curl -s -J -XGET "https://api.lytics.io/api/segmentml/all::smt_power" -H "Authorization: $LIOKEY"
``
URL Parameters
idrequiredstringExample:
source::targetQuery Parameters
account_idoptionalstringHeaders
AuthorizationoptionalstringOK
SegmentML Delete
https://api.lytics.io/api/segmentml/{id}Delete a SegmentML model.
``sh
# Curl example of deleting a SegmentML model
curl -s -J -XDELETE "https://api.lytics.io/api/segmentml/all::smt_power" -H "Authorization: $LIOKEY"
``
URL Parameters
idrequiredstringExample:
source::targetQuery Parameters
account_idoptionalstringHeaders
AuthorizationoptionalstringNo Content
SegmentML Create
https://api.lytics.io/api/segmentmlSegmentML Dependencies
https://api.lytics.io/api/segmentml/_dependencies/{modelname}URL Parameters
modelnamerequiredstringExample:
my_modelQuery Parameters
account_idoptionalstringHeaders
Authorizationoptionalstring{
"message": "success",
"status": 200,
"data": {
"fields": {
"lytics_score_frequency": [
[
1,
0.5283225806451614
],
[
4.6,
0.5283225806451614
],
[
8.2,
0.5281612903225807
]
],
"lytics_score_intensity": [
[
1,
0.5283225806451614
],
[
4.6,
0.5283225806451614
],
[
8.2,
0.5281612903225807
]
]
}
}
}