diff --git a/base/attributes.go b/base/attributes.go index 188ae99..48df381 100644 --- a/base/attributes.go +++ b/base/attributes.go @@ -39,5 +39,5 @@ type Attribute interface { // Tests whether two Attributes can be represented in the same pond // i.e. they're the same size, and their byte order makes them meaningful // when considered together - Compatable(Attribute) bool + Compatible(Attribute) bool } diff --git a/base/binary.go b/base/binary.go index 92de45b..1842cc2 100644 --- a/base/binary.go +++ b/base/binary.go @@ -62,9 +62,9 @@ func (b *BinaryAttribute) Equals(other Attribute) bool { } } -// Compatable checks whether this Attribute can be represented +// Compatible checks whether this Attribute can be represented // in the same pond as another. -func (b *BinaryAttribute) Compatable(other Attribute) bool { +func (b *BinaryAttribute) Compatible(other Attribute) bool { if _, ok := other.(*BinaryAttribute); !ok { return false } else { diff --git a/base/categorical.go b/base/categorical.go index c4629b1..be6d2b7 100644 --- a/base/categorical.go +++ b/base/categorical.go @@ -141,9 +141,9 @@ func (Attr *CategoricalAttribute) Equals(other Attribute) bool { return true } -// Compatable checks that this CategoricalAttribute has the same +// Compatible checks that this CategoricalAttribute has the same // values as another, in the same order. -func (Attr *CategoricalAttribute) Compatable(other Attribute) bool { +func (Attr *CategoricalAttribute) Compatible(other Attribute) bool { attribute, ok := other.(*CategoricalAttribute) if !ok { return false diff --git a/base/dense.go b/base/dense.go index a22eef1..cb30bde 100644 --- a/base/dense.go +++ b/base/dense.go @@ -180,8 +180,8 @@ func (inst *DenseInstances) addAttributeToAttributeGroup(newAttribute Attribute, id := inst.agMap[ag] p := inst.ags[id] for i, a := range p.Attributes() { - if !a.Compatable(newAttribute) { - return AttributeSpec{-1, 0, nil}, fmt.Errorf("Attribute %s is not compatable with %s in pond '%s' (position %d)", newAttribute, a, ag, i) + if !a.Compatible(newAttribute) { + return AttributeSpec{-1, 0, nil}, fmt.Errorf("Attribute %s is not Compatible with %s in pond '%s' (position %d)", newAttribute, a, ag, i) } } diff --git a/base/float.go b/base/float.go index fe2d66c..efb4551 100644 --- a/base/float.go +++ b/base/float.go @@ -18,9 +18,9 @@ func NewFloatAttribute(name string) *FloatAttribute { return &FloatAttribute{name, 2} } -// Compatable checks whether this FloatAttribute can be ponded with another +// Compatible checks whether this FloatAttribute can be ponded with another // Attribute (checks if they're both FloatAttributes) -func (Attr *FloatAttribute) Compatable(other Attribute) bool { +func (Attr *FloatAttribute) Compatible(other Attribute) bool { _, ok := other.(*FloatAttribute) return ok } diff --git a/base/util_instances.go b/base/util_instances.go index 75c908f..ab95efe 100644 --- a/base/util_instances.go +++ b/base/util_instances.go @@ -239,9 +239,9 @@ func SampleWithReplacement(from FixedDataGrid, size int) FixedDataGrid { return NewInstancesViewFromRows(from, rowMap) } -// CheckCompatable checks whether two DataGrids have the same Attributes +// CheckCompatible checks whether two DataGrids have the same Attributes // and if they do, it returns them. -func CheckCompatable(s1 FixedDataGrid, s2 FixedDataGrid) []Attribute { +func CheckCompatible(s1 FixedDataGrid, s2 FixedDataGrid) []Attribute { s1Attrs := s1.AllAttributes() s2Attrs := s2.AllAttributes() interAttrs := AttributeIntersect(s1Attrs, s2Attrs) diff --git a/knn/knn.go b/knn/knn.go index fd5bd5a..7831679 100644 --- a/knn/knn.go +++ b/knn/knn.go @@ -46,8 +46,8 @@ func (KNN *KNNClassifier) Predict(what base.FixedDataGrid) base.FixedDataGrid { panic("unsupported distance function") } - // Check compatability - allAttrs := base.CheckCompatable(what, KNN.TrainingData) + // Check Compatibility + allAttrs := base.CheckCompatible(what, KNN.TrainingData) if allAttrs == nil { // Don't have the same Attributes return nil