norm

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package norm provides functionality for normalizing data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToString

func ToString(n Normalizer) string

Types

type DataSource

type DataSource interface {
	MeanStdDev(column int) (mean, stdDev float64)
	Range(column int) (min, max float64)
}

type Gaussian

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

func (*Gaussian) DeNormalize

func (g *Gaussian) DeNormalize(value float64) float64

func (*Gaussian) GetArgs

func (g *Gaussian) GetArgs() []float64

func (*Gaussian) Initialize

func (g *Gaussian) Initialize(t DataSource, column int)

func (*Gaussian) Name

func (g *Gaussian) Name() string

func (*Gaussian) Normalize

func (g *Gaussian) Normalize(value float64) float64

func (*Gaussian) SetArgs

func (g *Gaussian) SetArgs(args ...float64) error

type Identity added in v0.2.0

type Identity struct{}

func (*Identity) DeNormalize added in v0.2.0

func (n *Identity) DeNormalize(value float64) float64

func (*Identity) GetArgs added in v0.2.0

func (n *Identity) GetArgs() []float64

func (*Identity) Initialize added in v0.2.0

func (n *Identity) Initialize(t DataSource, column int)

func (*Identity) Name added in v0.2.0

func (n *Identity) Name() string

func (*Identity) Normalize added in v0.2.0

func (n *Identity) Normalize(value float64) float64

func (*Identity) SetArgs added in v0.2.0

func (n *Identity) SetArgs(args ...float64) error

type Normalizer

type Normalizer interface {
	Name() string
	Normalize(value float64) float64
	DeNormalize(value float64) float64
	Initialize(t DataSource, column int)
	SetArgs(args ...float64) error
	GetArgs() []float64
}

func FromString

func FromString(nameAndArgs string) (Normalizer, error)

type Uniform

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

func (*Uniform) DeNormalize

func (u *Uniform) DeNormalize(value float64) float64

func (*Uniform) GetArgs

func (u *Uniform) GetArgs() []float64

func (*Uniform) Initialize

func (u *Uniform) Initialize(t DataSource, column int)

func (*Uniform) Name

func (u *Uniform) Name() string

func (*Uniform) Normalize

func (u *Uniform) Normalize(value float64) float64

func (*Uniform) SetArgs

func (u *Uniform) SetArgs(args ...float64) error

Jump to

Keyboard shortcuts

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