mat

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2023 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetVectorMaxIdx

func GetVectorMaxIdx(v *Vector) (int, error)

GetVectorMaxIdx gets the index of the maximum value within a vector.

func IsEqualMatrices

func IsEqualMatrices(m1, m2 *Matrix, threshold float32) error

IsEqualMatrices compares 2 matrices with a threshold.

func IsEqualVectors

func IsEqualVectors(v1, v2 *Vector, threshold float32) error

IsEqualVectors compares 2 vectors with a threshold.

Types

type Matrix

type Matrix struct {
	Vectors []*Vector
}

Matrix is a list of vector.

func ReadCSVFileToDenseMatrix

func ReadCSVFileToDenseMatrix(fileName string, delimiter string, defaultVal float32) (Matrix, error)

ReadCSVFileToDenseMatrix reads CSV file to dense matrix.

type SparseMatrix

type SparseMatrix struct {
	Vectors []SparseVector
}

SparseMatrix is a list of sparse vectors.

func ReadLibsvmFileToSparseMatrix

func ReadLibsvmFileToSparseMatrix(fileName string) (SparseMatrix, error)

ReadLibsvmFileToSparseMatrix reads libsvm file into sparse matrix.

type SparseVector

type SparseVector map[int]float32

SparseVector is a map with index is a key and value is a value at that index.

type Vector

type Vector []float32

Vector is a list of float numbers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL