Skip to content

Instantly share code, notes, and snippets.

@ajtulloch
Created November 3, 2013 18:44
Show Gist options
  • Save ajtulloch/7293393 to your computer and use it in GitHub Desktop.
Save ajtulloch/7293393 to your computer and use it in GitHub Desktop.
features := c.featureSelector.getFeatures(examples)
candidateSplits := make(chan split, len(features))
for _, feature := range features {
go func(feature int) {
candidateSplits <- getBestSplit(examples, feature)
}(feature)
}
bestSplit := split{}
for _ = range features {
candidateSplit := <-candidateSplits
if candidateSplit.gain > bestSplit.gain {
bestSplit = candidateSplit
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment