Documentation
¶
Overview ¶
Package layer provides SOM layers.
Index ¶
- type Layer
- func (l *Layer) Column(col string) int
- func (l *Layer) ColumnMatrix(col int) [][]float64
- func (l *Layer) ColumnNames() []string
- func (l *Layer) Columns() int
- func (l *Layer) CoordsAt(idx int) (int, int)
- func (l *Layer) DeNormalize()
- func (l *Layer) Get(x, y, col int) float64
- func (l *Layer) GetAt(idx, col int) float64
- func (l *Layer) GetNode(x, y int) []float64
- func (l *Layer) GetNodeAt(idx int) []float64
- func (l *Layer) IsCategorical() bool
- func (l *Layer) Metric() distance.Distance
- func (l *Layer) Name() string
- func (l *Layer) Nodes() int
- func (l *Layer) Normalizers() []norm.Normalizer
- func (l *Layer) Set(x, y, col int, value float64)
- func (l *Layer) SetAt(idx, col int, value float64)
- func (l *Layer) Weight() float64
- func (l *Layer) Weights() []float64
- type Size
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Layer ¶
type Layer struct {
// contains filtered or unexported fields
}
Layer represents a layer of data in a Self-organizing Map.
func New ¶
func New(name string, columns []string, normalizers []norm.Normalizer, size Size, metric distance.Distance, weight float64, categorical bool) (*Layer, error)
New creates a new Layer.
func NewWithData ¶
func NewWithData(name string, columns []string, normalizers []norm.Normalizer, size Size, metric distance.Distance, weight float64, categorical bool, data []float64) (*Layer, error)
NewWithData creates a new Layer with the given initial data.
func (*Layer) Column ¶
Column returns the index of the column with the given name in the Layer. If the column is not found, it returns -1.
func (*Layer) ColumnMatrix ¶
ColumnMatrix returns a 2D slice of float64 values representing the data for the specified column in the Layer. Each inner slice represents a row in the Layer, and the values in the slice correspond to the values in that column.
func (*Layer) ColumnNames ¶
ColumnNames returns the names of the columns in the Layer.
func (*Layer) CoordsAt ¶
CoordsAt returns the (x, y) coordinates of the node at the specified index.
func (*Layer) DeNormalize ¶
func (l *Layer) DeNormalize()
DeNormalize all weight vectors in place. Applies the inverse of each column's normalizer to the column's values.
func (*Layer) GetNode ¶
GetNode returns a slice of float64 values representing the data for the node at the specified (x, y) coordinates in the Layer. The slice contains the values for each column in the Layer, in the same order as the columns slice.
func (*Layer) GetNodeAt ¶
GetNodeAt returns a slice of float64 values representing the data for the node at the index in the Layer. The slice contains the values for each column in the Layer, in the same order as the columns slice.
func (*Layer) IsCategorical ¶
IsCategorical returns whether the Layer contains categorical data.
func (*Layer) Normalizers ¶
func (l *Layer) Normalizers() []norm.Normalizer
Normalizers returns the list of normalizers used by the Layer.