1
0
mirror of https://github.com/sjwhitworth/golearn.git synced 2025-04-25 13:48:49 +08:00
golearn/base/group.go
Richard Townsend 527c6476e1 Optimised version of KNN for Euclidean distances
This patch also:
   * Completes removal of the edf/ package
   * Corrects an erroneous print statement
   * Introduces two new CSV functions
      * ParseCSVToInstancesTemplated makes sure that
        reading a second CSV file maintains strict Attribute
        compatibility with an existing DenseInstances
      * ParseCSVToInstancesWithAttributeGroups gives more control
        over where Attributes end up in memory, important for
        gaining predictable control over the KNN optimisation
      * Decouples BinaryAttributeGroup from FixedAttributeGroup for
        better casting support
2014-09-30 23:10:22 +01:00

31 lines
810 B
Go

package base
import (
"bytes"
)
// AttributeGroups store related sequences of system values
// in memory for the DenseInstances structure.
type AttributeGroup interface {
// Used for printing
appendToRowBuf(row int, buffer *bytes.Buffer)
// Adds a new Attribute
AddAttribute(Attribute) error
// Returns all Attributes
Attributes() []Attribute
// Gets the byte slice at a given column, row offset
get(int, int) []byte
// Stores the byte slice at a given column, row offset
set(int, int, []byte)
// Sets the reference to underlying memory
setStorage([]byte)
// Gets the size of each row in bytes (rounded up)
RowSizeInBytes() int
// Adds some storage to this group
resize(int)
// Gets a reference to underlying memory
Storage() []byte
// Returns a human-readable summary
String() string
}