mirror of
https://github.com/sjwhitworth/golearn.git
synced 2025-04-26 13:49:14 +08:00
naive: deterministic Attribute order
This commit is contained in:
parent
bb1257563b
commit
d4ac151271
@ -71,7 +71,7 @@ func (nb *BernoulliNBClassifier) Fit(X base.FixedDataGrid) {
|
||||
// Check that all Attributes are binary
|
||||
classAttrs := X.AllClassAttributes()
|
||||
allAttrs := X.AllAttributes()
|
||||
featAttrs := base.AttributeDifferenceReferences(allAttrs, classAttrs)
|
||||
featAttrs := base.AttributeDifference(allAttrs, classAttrs)
|
||||
for i := range featAttrs {
|
||||
if _, ok := featAttrs[i].(*base.BinaryAttribute); !ok {
|
||||
panic(fmt.Sprintf("%v: Should be BinaryAttribute", featAttrs[i]))
|
||||
|
Loading…
x
Reference in New Issue
Block a user