mirror of
https://github.com/sjwhitworth/golearn.git
synced 2025-04-26 13:49:14 +08:00
24 lines
647 B
Go
24 lines
647 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
|
|
// Gets a string for printing
|
|
String() string
|
|
// Accepts an old Attribute, the new one and returns a sequence
|
|
Transform(Attribute, Attribute, []byte) []byte
|
|
// Builds the filter
|
|
Train() error
|
|
}
|