1
0
mirror of https://github.com/sjwhitworth/golearn.git synced 2025-05-01 22:18:10 +08:00

Merge pull request #140 from rschmukler/id3_fix

fix(id3): fix panic on SplitAttribute being nil
This commit is contained in:
Richard Townsend 2016-07-04 13:24:30 +01:00 committed by GitHub
commit 7df81bb286

View File

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