1
0
mirror of https://github.com/sjwhitworth/golearn.git synced 2025-04-26 13:49:14 +08:00

fix(id3): fix panic on SplitAttribute being nil

This commit is contained in:
Ryan Schmukler 2016-06-28 14:36:48 -04:00
parent 3fbf507799
commit cf6192c81c

View File

@ -113,7 +113,7 @@ func InferID3Tree(from base.FixedDataGrid, with RuleGenerator) *DecisionTreeNode
// Generate the splitting rule
splitRule := with.GenerateSplitRule(from)
if splitRule == nil {
if splitRule == nil || splitRule.SplitAttr == nil {
// Can't determine, just return what we have
return ret
}