Skip to content

Instantly share code, notes, and snippets.

@jhob
Last active December 5, 2016 18:04
Show Gist options
  • Save jhob/db62122ebdcd39b48b9c63bc8d4d347d to your computer and use it in GitHub Desktop.
Save jhob/db62122ebdcd39b48b9c63bc8d4d347d to your computer and use it in GitHub Desktop.
Example decision tree for recommending homepage module
{
"decisionTree": {
"test": {"foodInterests": "gluten-free"},
"children": {
"true": {
"test": {"foodInterests": "paleo"},
"children": {
"true" : {
"test": {"orderCount": 0},
"children": {
"true": [
"module-1", "module-2", "module-3"
],
"false": [
"module-1", "module-3", "module-2"
]
}
},
"false" : {
"test": {"orderCount": 0},
"children": {
"true": [
"module-2", "module-3", "module-1"
],
"false": [
"module-2", "module-1", "module-3"
]
}
}
}
},
"false": {
"test": {"foodInterests": "paleo"},
"children": {
"true": {
"test": {"orderCount": 0},
"children": {
"true": [
"module-1", "module-2", "module-3"
],
"false": [
"module-3", "module-2", "module-1"
]
}
},
"false": {
"test": {"orderCount": 0},
"children": {
"true": [
"module-3", "module-1", "module-2"
],
"false": [
"module-3", "module-2", "module-1"
]
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment