Documentation ¶
Index ¶
- func GCD(a int, b int) int
- func Moebius(n int) int
- func NewMatrixWithValue(nrows, ncols int, fillValue float64) *mat.Dense
- func PrimeFactorExponent(n int, p int) int
- func PrimeFactorization(n int) []int
- func Totient(n int) []int
- type AverageFilter
- type FIFOStack
- type Filter
- type GaussianFilter
- type Limiter
- type MinMaxScaler
- type Scaler
- type StandardScaler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Moebius ¶
Implementation of the Möbius function. Returns +1 if n is a square-free positive integer with an even number of prime factors, -1 if n is a square-free positive integer with an odd number of prime factors, 0 if n has a squared prime factor.
func NewMatrixWithValue ¶
NewMatrixWithValue returns a new matrix populated with a specific value.
func PrimeFactorExponent ¶
PrimeFactorExponent calculates how many times a prime `p` exists in the factorization of a given number `n`.
func PrimeFactorization ¶
PrimeFactorization return an array of the prime factors of the number n.
Types ¶
type AverageFilter ¶
type AverageFilter struct {
// contains filtered or unexported fields
}
#region Average Filter
func NewAverageFilter ¶
func NewAverageFilter(k int) *AverageFilter
NewAverageFilter constructs a kernel of size 2*k+1, resulting in a filter matrix of size (2k+1)x(2k+1).
type FIFOStack ¶
type FIFOStack[T any] struct { // contains filtered or unexported fields }
FIFOStack provides an implementation of a First-In-First-Out (FIFO) data structure.
func NewFIFOStack ¶
NewFIFOStack initializes a new stack with the given maximum number of elements (maxSize).
func (*FIFOStack[T]) Clear ¶
func (s *FIFOStack[T]) Clear()
Clear removes all elements from the stack.
func (*FIFOStack[T]) Elements ¶
func (s *FIFOStack[T]) Elements() []*T
Elements returns the stacked elements in correct order.
type GaussianFilter ¶
type GaussianFilter struct {
// contains filtered or unexported fields
}
#region GaussianFilter
func NewGaussianFilter ¶
func NewGaussianFilter(k int, sigma *float64) *GaussianFilter
NewGaussianFilter constructs a gauss kernel of size 2*k+1, resulting in a filter matrix of size (2k+1)x(2k+1).
type Limiter ¶
type Limiter struct {
// contains filtered or unexported fields
}
func NewLimiter ¶
func (*Limiter) InverseTransform ¶
InverseTransform of the limiter is incapable of reversing the transformation, thus returning the input value.
type MinMaxScaler ¶
type MinMaxScaler struct {
// contains filtered or unexported fields
}
#region MinMaxScaler
func NewMinMaxScaler ¶
func NewMinMaxScaler() *MinMaxScaler
NewMinMaxScaler returns a new instance of the MinMaxScaler.
func (*MinMaxScaler) Fit ¶
func (s *MinMaxScaler) Fit(data []float64)
func (*MinMaxScaler) GetParam ¶
func (s *MinMaxScaler) GetParam(key string) *float64
func (*MinMaxScaler) InverseTransform ¶
func (s *MinMaxScaler) InverseTransform(v float64) float64
func (*MinMaxScaler) Transform ¶
func (s *MinMaxScaler) Transform(v float64) float64
type StandardScaler ¶
type StandardScaler struct {
// contains filtered or unexported fields
}
#region StandardScaler
func NewStandardScaler ¶
func NewStandardScaler() *StandardScaler
StandardScaler returns a new instance of the StandardScaler.
func (*StandardScaler) Fit ¶
func (s *StandardScaler) Fit(data []float64)
func (*StandardScaler) GetParam ¶
func (s *StandardScaler) GetParam(key string) *float64
func (*StandardScaler) InverseTransform ¶
func (s *StandardScaler) InverseTransform(v float64) float64
func (*StandardScaler) Transform ¶
func (s *StandardScaler) Transform(v float64) float64