Documentation
¶
Overview ¶
Package conv provides functions for converting between various data types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClassesToIndices ¶
func ClassesToIndices[T comparable](classes []T, noData T) (columns []T, indices []int)
ClassesToIndices converts a slice of class labels to a slice of class indices and a slice of unique class labels.
func ClassesToTable ¶
func ClassesToTable[T comparable](classes []T, columns []T, noData T) (*table.Table, error)
ClassesToTable creates a table.Table from a slice of class labels. If the columns parameter is empty, the table will have a column for each unique class label. If the columns parameter is provided, the table will have a column for each provided class label, and an error will be returned if any duplicate class labels are found.
func LayerToClasses ¶
LayerToClasses converts a layer.Layer into a slice of class labels and a slice of class indices. For each node in the layer, the function finds the column with the maximum value and returns the index of that column as the class label. The function returns two slices: the first slice contains the column names (class labels), and the second slice contains the class indices for each node.
func TableToClasses ¶
TableToClasses converts a table.Table into a slice of class labels and a slice of class indices. For each row in the table, the function finds the column with the maximum value and returns the index of that column as the class label. The function returns two slices: the first slice contains the column names (class labels), and the second slice contains the class indices for each row.
Types ¶
This section is empty.