Documentation ¶
Overview ¶
Package num provides various numeric functions.
Index ¶
- func BoolToInt(b bool) int
- func F32SliceToF64(s []float32) []float64
- func I32SliceToI(s []int32) []int
- func MakeIRange(min, max int) []int
- func MaxF32(vals []float32) (int, float32)
- func Mean(vals []float32) float32
- func MeanNorm(x, min, max, average float32) float32
- func MinMaxNorm(x, min, max float32) float32
- func RandF32(min, max float32) float32
- func StdDev(x []float32) float32
- func ToF32(i interface{}) (float32, error)
- func ToF64(i interface{}) (float64, error)
- func Variance(vals []float32) float32
- func ZNorm(x, mean, stdDev float32) float32
- type EqWidthBinner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func F32SliceToF64 ¶
F32SliceToF64 converts a float32 slice to a float64 slice.
func I32SliceToI ¶
I32SliceToI converts an int32 slice to an int slice.
func MakeIRange ¶
MakeIRange creates an int slice for the given range.
Types ¶
type EqWidthBinner ¶
type EqWidthBinner struct { // NumIntervals is the number of bins. NumIntervals int // High is the upper bound of the continuous space. High float32 // Low is the lower bound of the continuous space. Low float32 // contains filtered or unexported fields }
EqWidthBinner implements the equal width binning algorithm. This is used to discretize continuous spaces.
func NewEqWidthBinner ¶
func NewEqWidthBinner(numIntervals int, high, low float32) *EqWidthBinner
NewEqWidthBinner returns an EqWidthBin.
Click to show internal directories.
Click to hide internal directories.