debiaser

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChunkDebiaser

type ChunkDebiaser struct {
	GeneralDebiaser
	// ScoreWindow defines the range of Vals used per window.
	// E.g. if this is 0.1 then all values from 0.25-0.35 will be normalized to the median of
	// Depths occuring in that range.
	ScoreWindow float64
}

func (*ChunkDebiaser) Debias

func (cd *ChunkDebiaser) Debias(imat *mat.Dense)

type Debiaser

type Debiaser interface {
	Debias(*mat.Dense)
}

Debiaser implements inplace removal of bias from a mat64 of (scaled) values.

type GeneralDebiaser

type GeneralDebiaser struct {
	Vals   []float64
	Window int
	// contains filtered or unexported fields
}

GeneralDebiaser is an implementation of a SortedDebiaser that can be used simply by setting attributes.int Window is the size of the moving window for correction. Usage is to Call GeneralDebiaser.Sort() then Debias(), then Unsort(). Presumbly, Those calls will be flanked by a scaler call such as to scaler.ZScore.

func (*GeneralDebiaser) Debias

func (g *GeneralDebiaser) Debias(imat *mat.Dense)

Debias by subtracting moving median in each sample. It's assumed that g.Sort() has been called before this and that g.Unsort() will be called after. It's also assumed that the values in mat have been scaled, for example by a `scaler.ZScore`.

func (*GeneralDebiaser) Sort

func (g *GeneralDebiaser) Sort(mat *mat.Dense)

Sort sorts the rows in mat according the order in g.Vals.

func (*GeneralDebiaser) Unsort

func (g *GeneralDebiaser) Unsort(mat *mat.Dense)

Unsort reverts the values to be position sorted.

type SVD

type SVD struct {
	MinVariancePct float64
}

func (*SVD) Debias

func (isvd *SVD) Debias(imat *mat.Dense)

type SortedDebiaser

type SortedDebiaser interface {
	Sorter
	Debiaser
}

SortedDebiaser is useful when we need to: sort, then unbias based on that sort order, then unsort. An example of this is for GC bias.

type Sorter

type Sorter interface {
	Sort(*mat.Dense)
	Unsort(*mat.Dense)
}

Sorter provides method to sort and then unsort a mat64

Jump to

Keyboard shortcuts

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