1
0
mirror of https://github.com/sjwhitworth/golearn.git synced 2025-05-07 19:29:19 +08:00
golearn/base/filters.go
2014-08-03 15:16:38 +01:00

22 lines
572 B
Go

package base
// FilteredAttributes represent a mapping from the output
// generated by a filter to the original value.
type FilteredAttribute struct {
Old Attribute
New Attribute
}
// Filters transform the byte sequences stored in DataGrid
// implementations.
type Filter interface {
// Adds an Attribute to the filter
AddAttribute(Attribute) error
// Allows mapping old to new Attributes
GetAttributesAfterFiltering() []FilteredAttribute
// Accepts an old Attribute and a byte sequence
Transform(Attribute, []byte) []byte
// Builds the filter
Train() error
}