MCPcopy Create free account
hub / github.com/apple/coremltools / setupLeafNode

Method setupLeafNode

mlmodel/src/transforms/TreeEnsemble.cpp:137–147  ·  view source on GitHub ↗

* If this is called, a node is created that is marked as a leaf evaluation node, * which means that when this node is triggered, a value is added to the * total prediction value. Currently, the sum total of all activated leaves * is returned as the prediction value. */

Source from the content-addressed store, hash-verified

135 * is returned as the prediction value.
136 */
137 void TreeEnsembleBase::setupLeafNode(size_t treeId, size_t nodeId, double value) {
138 Specification::TreeEnsembleParameters::TreeNode& node = _getNode(treeId, nodeId, true);
139
140 // TODO: Error checking routines -- make sure this node hasn't been requested before.
141 node.set_nodebehavior(Specification::TreeEnsembleParameters::TreeNode::LeafNode);
142
143 node.clear_evaluationinfo();
144 auto ei = node.add_evaluationinfo();
145 ei->set_evaluationindex(0);
146 ei->set_evaluationvalue(value);
147 }
148
149 /**
150 * If this is called, a node is created that is marked as a leaf evaluation node,

Callers 1

testTreeEnsembleBasicFunction · 0.80

Calls

no outgoing calls

Tested by 1

testTreeEnsembleBasicFunction · 0.64