faqs

a decision is "good" if it is predicted to improve a metric we care about.

sample

identify the units—customers, sessions, or events—about which decisions need to be made. be as specific as possible. if it's clicks of a checkout button, do you care they're coming from returning users, or only first-time customers?

attributes

record the properties or features of each historical sample that received a decision. these properties must have been known and accessible at the time the decision was be made.

decision

record the numerical (e.g. price) or categorical (e.g. "admit" or "reject") choice made on behalf of each event or sample.

outcome

record the outcome of the decision on the given sample. this should be a "bigger is better" quantity, such as profitrevenue, or growth, as opposed to churn or latency, although the latter cases are permissible if a minus sign is put in front.

1. enter comma-separated decision input values, ordered the same as the attributes, optionally with a prefixed label, and hit return.

2. note the suggested optimal decision and your target metric's expected outcome.

3. optionally record the dash decision ID.

4. view the comparison between the suggested decision and the past outcomes of decisions with similar inputs.

Screenshot 2021-10-09 21.28.53.png

your dash endpoint, found in the console, is called with a POST request.

Screenshot 2021-10-09 23.03.03.png
pngwing.com (1).png

1. express your request in any of these JSON formats:

single request—comma-separated input values

{
  "values": "935, 144, 22, 103",
  "attributes": ["avg_txn", "acct_age_wks", "wks_since_last_txn", "num_txns"], 
}

single labeled request—comma-separated input values following colon-separated label

{
  "values": "foo: 935, 144, 22, 103",
"attributes": ["avg_txn", "acct_age_wks", "wks_since_last_txn", "num_txns"], 
}

single request—array of input values

{
  "values": [935, 144, 22, 103],
  "attributes": ["avg_txn", "acct_age_wks", "wks_since_last_txn", "num_txns"],
}

single or bulk labeled request—key-value pairs of label and input values

{
  "values": {
    "foo": [935, 144, 22, 103],
    "bar": [332, 40, 38, 2]
  },
  "attributes": ["avg_txn", "acct_age_wks", "wks_since_last_txn", "num_txns"],
}

2. form the following request:

curl

$ curl -X POST https://dash.dcyd.io/139823c5c4c52628b2506734031ab1/decide -H 'Content-Type: application/json' \
-d '{"attributes": ["avg_txn", "acct_age_wks", "wks_since_last_txn", "num_txns"], "values": {"foo": [935,144,22,103],
 "bar": [332,40,38, 2]}}'

python

>>> import requests
>>> url = 'https://dash.dcyd.io/139823c5c4c52628b2506734031ab1/decide'
>>> attributes = ["avg_txn", "acct_age_wks", "wks_since_last_txn", "num_txns"]
>>> values = {"foo": [935, 144, 22, 103],
 "bar": [332, 40, 38, 2]}
>>> r = requests.post(url, json={'attributes': attributes, 'values': values})
>>> r.json()

characteristic response

{
  "data": {
    "decisions": {
      "foo": {
        "dash_decision_id": "bd8598baf1f2c0cde1de5a6381fc67c814aa6241", 
        "discount_pct": 1.3894736842105262, 
        "profit_2_wks": 20.34692121239032
      }, 
      "bar": {
        "dash_decision_id": "16828cc08ef9eefa9ed6d3f12ab09a24e508d317", 
        "discount_pct": 8.336842105263157, 
        "profit_2_wks": 6.64249990433675
      }
    }, 
    "labels": {
      "decision_parameters": [
        "discount_pct"
      ], 
      "outcome": "profit_2_wks"
    }
  }, 
  "status": "ok"
}