Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
operational-decision-tree
Advanced tools
A Decision Tree executor that uses decision modules to decide pathways. Can accept binary or arbitrary decision modules.
This package is brand new. I have yet to use it for the project I built it for. Consequently, this project may change soon.
ODT is not designed to be a machine learning decision tree. By all means though, use it how you want.
ODT is a decision tree executor designed to run decision trees that are human-built and managed. Hence, it has features targetted at reducing the total number of nodes needed to achieve the desired leaf nodes.
For each condition, ODT compares the subject data to the tree data based on the "operation" parameter you pass in the tree. Supported operations are:
subject value is greater than tree comparison value
= subject value is greater than or equal to tree comparison value
Several things are required to use an ODT:
Depending on the tree data you provide, the executor supports any combination of the following:
binary-tree.json
{
"condition": {
"name": "conditionAge",
"property": "age",
"comparison": {
"operation": ">",
"value": 40
}
},
"branches": [
{
"condition": {
"name": "conditionAge",
"property": "age",
"comparison": {
"operation": ">",
"value": 20
}
},
"branches": [
{"result": "Leaf A: Aged between 0 and 20"},
{"result": "Leaf B: Aged between 21 and 39"}
]
},
{
"condition": {
"name": "conditionCountry",
"property": "nationality",
"comparison": {
"operation": "in",
"value": ["US", "CA"]
}
},
"branches": [
{"result": "Leaf C: Over 40 and not from North America"},
{"result": "Leaf D: Over 40 and from the North America"}
]
}
]
}
var ODT = require('operational-decision-tree')
var treeData = require('./binary-tree.json')
var person = {
name: "Bob",
age: 37,
nationality: 'US'
}
var DecisionTree = new ODT()
DecisionTree.run(treeData, person, function (err, result) {
if (err) console.error("ERROR", err)
console.log("RESULT", result)
})
Multi-condition nodes are useful for reducing the number of nodes needed for specific outcomes. They work well with binary trees, since the decision maker can resolve them with an && operation. However, when paired with arbitrary conditions, you may run into some problems depending on how your arbitrary conditions are setup.
FAQs
A Decision Tree executor that uses decision modules to decide pathways. Can accept binary or arbitrary decision modules.
The npm package operational-decision-tree receives a total of 1 weekly downloads. As such, operational-decision-tree popularity was classified as not popular.
We found that operational-decision-tree demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.