floats

package
v0.0.0-...-e74b012 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EuclideanDistance

func EuclideanDistance(x1, x2, y1, y2 float64) float64

EuclideanDistance ...

func Knn

func Knn(in []float64, x, y, classifier []float64, k int, distanceFn func(x1, x2, y1, y2 float64) float64) float64

Knn ...

func ManhattanDistance

func ManhattanDistance(x1, x2, y1, y2 float64) float64

ManhattanDistance ...

func Maximum

func Maximum(in []float64) (out float64)

Maximum returns the greatest number.

func Mean

func Mean(in []float64) (out float64)

Mean is the average of the given values.

func Median

func Median(in []float64) (out float64)

Median is the number that separates the lower half of the values from the upper half.

func MinMaxScale

func MinMaxScale(in []float64)

MinMaxScale (Normalization) scales the values down to a value between 0 and 1.

func Minimum

func Minimum(in []float64) (out float64)

Minimum returns the smallest number.

func Mode

func Mode(in []float64) (out float64)

Mode is the most repeated number.

func Range

func Range(in []float64) (out float64)

Range measures the absolut difference between the Minimum and Maximum of the numbers.

func Replace

func Replace(in []float64, before, after float64)

Replace sets all matching numbers to a new value.

func StandardDeviation

func StandardDeviation(in []float64) (out float64)

StandardDeviation measures how spread out numbers are. A higher value means more spread out numbers.

func StandardScale

func StandardScale(in []float64)

StandardScale (Standardization) scales the values down to a value between Mean(0) and Standard Deviation (1).

func Variance

func Variance(in []float64) (out float64)

Variance measures the average of the squared differences from the Mean.

Types

type Pieces

type Pieces struct {
	// contains filtered or unexported fields
}

Pieces offers concurrent access to each of goroutine during apply state.

func (*Pieces) SplitApplyCombine

func (p *Pieces) SplitApplyCombine(in []float64, apply func(in []float64) (out float64), combine func(in []float64) (out float64)) (out float64)

SplitApplyCombine break up a slice of float64 data into smaller pieces (split), operate on each piece independently by a goroutine (apply) and put all the pieces back together (combine).

Jump to

Keyboard shortcuts

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