Created
November 3, 2013 18:43
-
-
Save ajtulloch/7293383 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Recur down the left and right branches in parallel | |
w := sync.WaitGroup{} | |
recur := func(child **pb.TreeNode, e Examples) { | |
w.Add(1) | |
go func() { | |
*child = c.generateTree(e, currentLevel+1) | |
w.Done() | |
}() | |
} | |
recur(&tree.Left, examples[bestSplit.index:]) | |
recur(&tree.Right, examples[:bestSplit.index]) | |
w.Wait() | |
return tree |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment