Documentation
¶
Overview ¶
Package mlearning provides a few abstracted machine learning algorithms.
Index ¶
- type Class
- type Feature
- type FeatureCollection
- type Iterator
- type Model
- type Perceptron
- func (p *Perceptron) Predict(features []Feature) (Class, Weight)
- func (p *Perceptron) PredictAll(features []Feature) []Prediction
- func (p *Perceptron) Test(fs Iterator) (int, int)
- func (p *Perceptron) Train(fs Iterator) (int, int)
- func (p *Perceptron) Update(truth Class, guess Class, features []Feature)
- func (p *Perceptron) UpdateFeature(c Class, f Feature, w Weight)
- type Prediction
- type SimpleIterator
- type Weight
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FeatureCollection ¶
type FeatureCollection interface {
Features() []Feature
}
type Model ¶
type Perceptron ¶
type Perceptron struct {
*Model
}
func NewPerceptron ¶
func NewPerceptron() *Perceptron
func (*Perceptron) PredictAll ¶
func (p *Perceptron) PredictAll(features []Feature) []Prediction
func (*Perceptron) Update ¶
func (p *Perceptron) Update(truth Class, guess Class, features []Feature)
func (*Perceptron) UpdateFeature ¶
func (p *Perceptron) UpdateFeature(c Class, f Feature, w Weight)
type Prediction ¶
type SimpleIterator ¶
type SimpleIterator struct { Index int FeatureSlice []FeatureCollection ClassSlice []Class PredictedSlice []Class }
func (*SimpleIterator) Class ¶
func (i *SimpleIterator) Class() Class
func (*SimpleIterator) Features ¶
func (i *SimpleIterator) Features() []Feature
func (*SimpleIterator) Next ¶
func (i *SimpleIterator) Next() bool
func (*SimpleIterator) Predicted ¶
func (i *SimpleIterator) Predicted(c Class)
func (*SimpleIterator) Reset ¶
func (i *SimpleIterator) Reset(shuffle bool)
Click to show internal directories.
Click to hide internal directories.