Documentation ¶
Index ¶
- func RandomVector(mean, sd []float64, r *rand.Rand) []float64
- type Model
- func (gmm *Model) Clear()
- func (gmm *Model) Dim() int
- func (gmm *Model) Estimate() error
- func (gmm *Model) LogProb(obs model.Obs) float64
- func (gmm *Model) Name() string
- func (gmm *Model) Predict(x model.Observer) ([]model.Labeler, error)
- func (gmm *Model) Sample(r *rand.Rand) model.Obs
- func (gmm *Model) SampleChan(r *rand.Rand, size int) <-chan model.Obs
- func (gmm *Model) Update(x model.Observer, w func(model.Obs) float64) error
- func (gmm *Model) UpdateOne(o model.Obs, w float64)
- func (gmm *Model) Write(w io.Writer) error
- func (gmm *Model) WriteFile(fn string) error
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Model ¶
type Model struct { Type string `json:"type"` ModelName string `json:"name"` ModelDim int `json:"dim"` NSamples float64 `json:"nsamples"` Diag bool `json:"diag"` NComponents int `json:"num_components"` PosteriorSum []float64 `json:"posterior_sum,omitempty"` Weights []float64 `json:"-"` LogWeights []float64 `json:"weights,omitempty"` Likelihood float64 `json:"likelihood"` Components []*gaussian.Model `json:"components,omitempty"` Iteration int `json:"iteration"` // contains filtered or unexported fields }
Model is a mixture of Gaussian distributions.
func RandomModel ¶
RandomModel generates a random Gaussian mixture model using mean and variance vectors as seed. Use this function to initialize the GMM before training. The mean and sd vector can be estimated from the data set using a Gaussian model.
func (*Model) SampleChan ¶
SampleChan returns a channel with samples generated by the GMM model.
type Option ¶
type Option func(*Model)
Option type is used to pass options to NewModel().
func Components ¶
Components sets the mixture components for the model.
func LogWeights ¶
LogWeights sets the mixture weights for the model using log(w) as the argument.
Click to show internal directories.
Click to hide internal directories.