vectorEstimator

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2020 License: GPL-3.0 Imports: 13 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HmmDataSet

type HmmDataSet interface {
	generic.HmmDataSet
	GetMappedData() ConstVector
	EvaluateLogPdf(edist []ScalarPdf, pool ThreadPool) error
}

type HmmEstimator

type HmmEstimator struct {

	// split data into smaller pieces
	// (disabled if set to 0)
	ChunkSize int
	// hook options
	SaveFile     string
	SaveInterval int
	Trace        string
	Verbose      int
	// estimator options
	OptimizeEmissions   bool
	OptimizeTransitions bool
	// contains filtered or unexported fields
}

func NewConstrainedHmmEstimator

func NewConstrainedHmmEstimator(pi Vector, tr Matrix, stateMap, startStates, finalStates []int, constraints []generic.EqualityConstraint, estimators []ScalarEstimator, epsilon float64, maxSteps int, args ...interface{}) (*HmmEstimator, error)

func NewHierarchicalHmmEstimator

func NewHierarchicalHmmEstimator(pi Vector, tr Matrix, stateMap, startStates, finalStates []int, tree generic.HmmNode, estimators []ScalarEstimator, epsilon float64, maxSteps int, args ...interface{}) (*HmmEstimator, error)

func NewHmmEstimator

func NewHmmEstimator(pi Vector, tr Matrix, stateMap, startStates, finalStates []int, estimators []ScalarEstimator, epsilon float64, maxSteps int, args ...interface{}) (*HmmEstimator, error)

func (*HmmEstimator) CloneVectorEstimator

func (obj *HmmEstimator) CloneVectorEstimator() VectorEstimator

func (*HmmEstimator) Dim

func (obj *HmmEstimator) Dim() int

func (*HmmEstimator) Emissions

func (obj *HmmEstimator) Emissions(gamma []DenseFloat64Vector, p ThreadPool) error

func (*HmmEstimator) Estimate

func (obj *HmmEstimator) Estimate(gamma ConstVector, p ThreadPool) error

func (*HmmEstimator) EstimateOnData

func (obj *HmmEstimator) EstimateOnData(x []ConstVector, gamma ConstVector, p ThreadPool) error

func (*HmmEstimator) EvaluateLogPdf

func (obj *HmmEstimator) EvaluateLogPdf(pool ThreadPool) error

func (*HmmEstimator) GetBasicHmm

func (obj *HmmEstimator) GetBasicHmm() generic.BasicHmm

func (*HmmEstimator) GetEstimate

func (obj *HmmEstimator) GetEstimate() (VectorPdf, error)

func (*HmmEstimator) GetParameters

func (obj *HmmEstimator) GetParameters() Vector

func (*HmmEstimator) ScalarType

func (obj *HmmEstimator) ScalarType() ScalarType

func (*HmmEstimator) SetData

func (obj *HmmEstimator) SetData(x []ConstVector, n int) error

func (*HmmEstimator) SetParameters

func (obj *HmmEstimator) SetParameters(parameters Vector) error

func (*HmmEstimator) Step

func (obj *HmmEstimator) Step(meta ConstVector, tmp []generic.BaumWelchTmp, p ThreadPool) (float64, error)

func (*HmmEstimator) Swap

func (obj *HmmEstimator) Swap()

type HmmStdDataRecord

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

func (HmmStdDataRecord) GetN

func (obj HmmStdDataRecord) GetN() int

func (HmmStdDataRecord) LogPdf

func (obj HmmStdDataRecord) LogPdf(r Scalar, c, k int) error

func (HmmStdDataRecord) MapIndex

func (obj HmmStdDataRecord) MapIndex(k int) int

type HmmStdDataSet

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

func NewHmmStdDataSet

func NewHmmStdDataSet(t ScalarType, x []ConstVector, k int) (*HmmStdDataSet, error)

func (*HmmStdDataSet) EvaluateLogPdf

func (obj *HmmStdDataSet) EvaluateLogPdf(edist []ScalarPdf, pool ThreadPool) error

func (*HmmStdDataSet) GetMappedData

func (obj *HmmStdDataSet) GetMappedData() ConstVector

func (*HmmStdDataSet) GetN

func (obj *HmmStdDataSet) GetN() int

func (*HmmStdDataSet) GetNMapped

func (obj *HmmStdDataSet) GetNMapped() int

func (*HmmStdDataSet) GetNRecords

func (obj *HmmStdDataSet) GetNRecords() int

func (*HmmStdDataSet) GetRecord

func (obj *HmmStdDataSet) GetRecord(i int) generic.HmmDataRecord

type HmmSummarizedDataRecord

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

func (HmmSummarizedDataRecord) GetN

func (obj HmmSummarizedDataRecord) GetN() int

func (HmmSummarizedDataRecord) LogPdf

func (obj HmmSummarizedDataRecord) LogPdf(r Scalar, c, k int) error

func (HmmSummarizedDataRecord) MapIndex

func (obj HmmSummarizedDataRecord) MapIndex(k int) int

type HmmSummarizedDataSet

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

func NewHmmSummarizedDataSet

func NewHmmSummarizedDataSet(t ScalarType, x []Vector, k int) (*HmmSummarizedDataSet, error)

func (*HmmSummarizedDataSet) EvaluateLogPdf

func (obj *HmmSummarizedDataSet) EvaluateLogPdf(edist []ScalarPdf, pool ThreadPool) error

func (*HmmSummarizedDataSet) GetMappedData

func (obj *HmmSummarizedDataSet) GetMappedData() ConstVector

func (*HmmSummarizedDataSet) GetN

func (obj *HmmSummarizedDataSet) GetN() int

func (*HmmSummarizedDataSet) GetNMapped

func (obj *HmmSummarizedDataSet) GetNMapped() int

func (*HmmSummarizedDataSet) GetNRecords

func (obj *HmmSummarizedDataSet) GetNRecords() int

func (*HmmSummarizedDataSet) GetRecord

func (obj *HmmSummarizedDataSet) GetRecord(i int) generic.HmmDataRecord

type LogisticRegression

type LogisticRegression struct {

	// optional parameters
	Balance        bool
	Epsilon        float64
	L1Reg          float64
	L2Reg          float64
	TiReg          float64
	StepSizeFactor float64
	MaxIterations  int
	ClassWeights   [2]float64
	Seed           int64
	Hook           func(x ConstVector, step, lambda ConstScalar, i int) bool
	// contains filtered or unexported fields
}

func NewLogisticRegression

func NewLogisticRegression(n int, sparse bool) (*LogisticRegression, error)

func (*LogisticRegression) Clone

func (obj *LogisticRegression) Clone() *LogisticRegression

func (*LogisticRegression) CloneVectorEstimator

func (obj *LogisticRegression) CloneVectorEstimator() VectorEstimator

func (LogisticRegression) Dim

func (obj LogisticRegression) Dim() int

func (*LogisticRegression) Estimate

func (obj *LogisticRegression) Estimate(gamma ConstVector, p ThreadPool) error

func (*LogisticRegression) EstimateOnData

func (obj *LogisticRegression) EstimateOnData(x []ConstVector, gamma ConstVector, p ThreadPool) error

func (*LogisticRegression) Execute

func (obj *LogisticRegression) Execute(
	epsilon saga.Epsilon,
	maxIterations saga.MaxIterations,
	hook saga.Hook) (DenseFloat64Vector, int64, error)

func (*LogisticRegression) GetData

func (obj *LogisticRegression) GetData() ([]ConstVector, int)

func (*LogisticRegression) GetEstimate

func (obj *LogisticRegression) GetEstimate() (VectorPdf, error)

func (*LogisticRegression) GetParameters

func (obj *LogisticRegression) GetParameters() Vector

func (*LogisticRegression) GetStepSize

func (obj *LogisticRegression) GetStepSize() float64

func (*LogisticRegression) Initialize

func (obj *LogisticRegression) Initialize(
	f saga.Objective1Sparse,
	n int,
	x DenseFloat64Vector,
	l1reg saga.L1Regularization,
	gamma saga.Gamma,
	seed saga.Seed,
	pool ThreadPool) error

func (LogisticRegression) LogPdfDense

func (obj LogisticRegression) LogPdfDense(x DenseFloat64Vector) float64

func (LogisticRegression) LogPdfSparse

func (obj LogisticRegression) LogPdfSparse(v SparseConstFloat64Vector) float64

func (*LogisticRegression) Reset

func (obj *LogisticRegression) Reset()

func (*LogisticRegression) ScalarType

func (obj *LogisticRegression) ScalarType() ScalarType

func (*LogisticRegression) SetData

func (obj *LogisticRegression) SetData(x []ConstVector, n int) error

x_i = (1.0, x_i1, x_i2, ..., x_im, class_label)

func (*LogisticRegression) SetDenseData

func (obj *LogisticRegression) SetDenseData(x []ConstVector, c []bool, n int) error

func (*LogisticRegression) SetLabels

func (obj *LogisticRegression) SetLabels(c []bool)

func (*LogisticRegression) SetParameters

func (obj *LogisticRegression) SetParameters(x Vector) error

func (*LogisticRegression) SetSparseData

func (obj *LogisticRegression) SetSparseData(x []ConstVector, c []bool, n int) error

func (*LogisticRegression) SetStepSize

func (obj *LogisticRegression) SetStepSize(gamma float64)

type MixtureDataSet

type MixtureDataSet interface {
	generic.MixtureDataSet
	GetData() []ConstVector
	EvaluateLogPdf(edist []VectorPdf, pool ThreadPool) error
}

type MixtureEstimator

type MixtureEstimator struct {

	// hook options
	SaveFile     string
	SaveInterval int
	Trace        string
	Verbose      int
	// estimator options
	OptimizeEmissions bool
	OptimizeWeights   bool
	// contains filtered or unexported fields
}

func NewMixtureEstimator

func NewMixtureEstimator(weights []float64, estimators []VectorEstimator, epsilon float64, maxSteps int, args ...interface{}) (*MixtureEstimator, error)

func (*MixtureEstimator) CloneVectorEstimator

func (obj *MixtureEstimator) CloneVectorEstimator() VectorEstimator

func (*MixtureEstimator) Dim

func (obj *MixtureEstimator) Dim() int

func (*MixtureEstimator) Emissions

func (obj *MixtureEstimator) Emissions(gamma []DenseFloat64Vector, p ThreadPool) error

func (*MixtureEstimator) Estimate

func (obj *MixtureEstimator) Estimate(gamma ConstVector, p ThreadPool) error

func (*MixtureEstimator) EstimateOnData

func (obj *MixtureEstimator) EstimateOnData(x []ConstVector, gamma ConstVector, p ThreadPool) error

func (*MixtureEstimator) EvaluateLogPdf

func (obj *MixtureEstimator) EvaluateLogPdf(pool ThreadPool) error

func (*MixtureEstimator) GetBasicMixture

func (obj *MixtureEstimator) GetBasicMixture() generic.BasicMixture

func (*MixtureEstimator) GetEstimate

func (obj *MixtureEstimator) GetEstimate() (VectorPdf, error)

func (*MixtureEstimator) GetParameters

func (obj *MixtureEstimator) GetParameters() Vector

func (*MixtureEstimator) ScalarType

func (obj *MixtureEstimator) ScalarType() ScalarType

func (*MixtureEstimator) SetData

func (obj *MixtureEstimator) SetData(x []ConstVector, n int) error

func (*MixtureEstimator) SetParameters

func (obj *MixtureEstimator) SetParameters(parameters Vector) error

func (*MixtureEstimator) Step

func (obj *MixtureEstimator) Step(gamma ConstVector, tmp []generic.EmTmp, p ThreadPool) (float64, error)

func (*MixtureEstimator) Swap

func (obj *MixtureEstimator) Swap()

type MixtureStdDataSet

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

func NewMixtureStdDataSet

func NewMixtureStdDataSet(t ScalarType, x []ConstVector, k int) (*MixtureStdDataSet, error)

func (*MixtureStdDataSet) EvaluateLogPdf

func (obj *MixtureStdDataSet) EvaluateLogPdf(edist []VectorPdf, pool ThreadPool) error

func (*MixtureStdDataSet) GetCounts

func (obj *MixtureStdDataSet) GetCounts() []int

func (*MixtureStdDataSet) GetData

func (obj *MixtureStdDataSet) GetData() []ConstVector

func (*MixtureStdDataSet) GetN

func (obj *MixtureStdDataSet) GetN() int

func (*MixtureStdDataSet) LogPdf

func (obj *MixtureStdDataSet) LogPdf(r Scalar, c, i int) error

type NilEstimator

type NilEstimator struct {
	VectorPdf
}

func (NilEstimator) CloneVectorEstimator

func (obj NilEstimator) CloneVectorEstimator() VectorEstimator

func (NilEstimator) Estimate

func (NilEstimator) Estimate(gamma ConstVector, p ThreadPool) error

func (NilEstimator) EstimateOnData

func (NilEstimator) EstimateOnData(x []ConstVector, gamma ConstVector, p ThreadPool) error

func (NilEstimator) GetEstimate

func (obj NilEstimator) GetEstimate() (VectorPdf, error)

func (NilEstimator) SetData

func (NilEstimator) SetData(x []ConstVector, n int) error

type NormalEstimator

type NormalEstimator struct {
	*vectorDistribution.NormalDistribution
	StdEstimator

	SigmaMin float64
	// contains filtered or unexported fields
}

func NewNormalEstimator

func NewNormalEstimator(mu, sigma []float64, sigmaMin float64) (*NormalEstimator, error)

func (*NormalEstimator) Clone

func (obj *NormalEstimator) Clone() *NormalEstimator

func (*NormalEstimator) CloneVectorBatchEstimator

func (obj *NormalEstimator) CloneVectorBatchEstimator() VectorBatchEstimator

func (*NormalEstimator) CloneVectorEstimator

func (obj *NormalEstimator) CloneVectorEstimator() VectorEstimator

func (*NormalEstimator) Estimate

func (obj *NormalEstimator) Estimate(gamma ConstVector, p ThreadPool) error

func (*NormalEstimator) EstimateOnData

func (obj *NormalEstimator) EstimateOnData(x []ConstVector, gamma ConstVector, p ThreadPool) error

func (*NormalEstimator) GetEstimate

func (obj *NormalEstimator) GetEstimate() (VectorPdf, error)

func (*NormalEstimator) Initialize

func (obj *NormalEstimator) Initialize(p ThreadPool) error

func (*NormalEstimator) NewObservation

func (obj *NormalEstimator) NewObservation(x ConstVector, gamma ConstScalar, p ThreadPool) error

type NormalSteinEstimator

type NormalSteinEstimator struct {
	NormalEstimator
}

func NewNormalSteinEstimator

func NewNormalSteinEstimator(mu, sigma []float64, sigmaMin float64) (*NormalSteinEstimator, error)

func (*NormalSteinEstimator) GetEstimate

func (obj *NormalSteinEstimator) GetEstimate() (VectorPdf, error)

type ScalarBatchId

type ScalarBatchId struct {
	Estimators []ScalarBatchEstimator
	// contains filtered or unexported fields
}

func NewScalarBatchId

func NewScalarBatchId(estimators ...ScalarBatchEstimator) (*ScalarBatchId, error)

func (*ScalarBatchId) Clone

func (obj *ScalarBatchId) Clone() *ScalarBatchId

func (*ScalarBatchId) CloneVectorBatchEstimator

func (obj *ScalarBatchId) CloneVectorBatchEstimator() VectorBatchEstimator

func (*ScalarBatchId) Dim

func (obj *ScalarBatchId) Dim() int

func (*ScalarBatchId) GetEstimate

func (obj *ScalarBatchId) GetEstimate() (VectorPdf, error)

func (*ScalarBatchId) GetParameters

func (obj *ScalarBatchId) GetParameters() Vector

func (*ScalarBatchId) Initialize

func (obj *ScalarBatchId) Initialize(p ThreadPool) error

func (*ScalarBatchId) NewObservation

func (obj *ScalarBatchId) NewObservation(x ConstVector, gamma ConstScalar, p ThreadPool) error

func (*ScalarBatchId) ScalarType

func (obj *ScalarBatchId) ScalarType() ScalarType

func (*ScalarBatchId) SetParameters

func (obj *ScalarBatchId) SetParameters(parameters Vector) error

type ScalarId

type ScalarId struct {
	Estimators []ScalarEstimator
	// contains filtered or unexported fields
}

func NewScalarId

func NewScalarId(estimators ...ScalarEstimator) (*ScalarId, error)

func (*ScalarId) Clone

func (obj *ScalarId) Clone() *ScalarId

func (*ScalarId) CloneVectorEstimator

func (obj *ScalarId) CloneVectorEstimator() VectorEstimator

func (*ScalarId) Dim

func (obj *ScalarId) Dim() int

func (*ScalarId) Estimate

func (obj *ScalarId) Estimate(gamma ConstVector, p ThreadPool) error

func (*ScalarId) EstimateOnData

func (obj *ScalarId) EstimateOnData(x []ConstVector, gamma ConstVector, p ThreadPool) error

func (*ScalarId) GetEstimate

func (obj *ScalarId) GetEstimate() (VectorPdf, error)

func (*ScalarId) GetParameters

func (obj *ScalarId) GetParameters() Vector

func (*ScalarId) ScalarType

func (obj *ScalarId) ScalarType() ScalarType

func (*ScalarId) SetData

func (obj *ScalarId) SetData(x []ConstVector, n int) error

func (*ScalarId) SetParameters

func (obj *ScalarId) SetParameters(parameters Vector) error

type ScalarIid

type ScalarIid struct {
	Estimator ScalarEstimator
	// contains filtered or unexported fields
}

func NewScalarIid

func NewScalarIid(estimator ScalarEstimator, n int) (*ScalarIid, error)

func (*ScalarIid) Clone

func (obj *ScalarIid) Clone() *ScalarIid

func (*ScalarIid) CloneVectorEstimator

func (obj *ScalarIid) CloneVectorEstimator() VectorEstimator

func (*ScalarIid) Dim

func (obj *ScalarIid) Dim() int

func (*ScalarIid) Estimate

func (obj *ScalarIid) Estimate(gamma ConstVector, p ThreadPool) error

func (*ScalarIid) EstimateOnData

func (obj *ScalarIid) EstimateOnData(x []ConstVector, gamma ConstVector, p ThreadPool) error

func (*ScalarIid) GetEstimate

func (obj *ScalarIid) GetEstimate() (VectorPdf, error)

func (*ScalarIid) GetParameters

func (obj *ScalarIid) GetParameters() Vector

func (*ScalarIid) ScalarType

func (obj *ScalarIid) ScalarType() ScalarType

func (*ScalarIid) SetData

func (obj *ScalarIid) SetData(x []ConstVector, n int) error

func (*ScalarIid) SetParameters

func (obj *ScalarIid) SetParameters(parameters Vector) error

type StdEstimator

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

func (*StdEstimator) GetData

func (obj *StdEstimator) GetData() ([]ConstVector, int)

func (*StdEstimator) SetData

func (obj *StdEstimator) SetData(x []ConstVector, n int) error

Jump to

Keyboard shortcuts

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