Ejemplo n.º 1
0
// AddAttribute add a given numeric Attribute `attr' to the
// filter.
//
// IMPORTANT: This function panic()s if it can't locate the
// attribute in the Instances set.
func (c *ChiMergeFilter) AddAttribute(attr base.Attribute) {
	if attr.GetType() != base.Float64Type {
		panic("ChiMerge only works on Float64Attributes")
	}
	attrIndex := c.Instances.GetAttrIndex(attr)
	if attrIndex == -1 {
		panic("Invalid attribute!")
	}
	c.Attributes = append(c.Attributes, attrIndex)
}