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:
parent
3fbf507799
commit
cf6192c81c
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user