Documentation ¶
Index ¶
- func EntropyAccumulatorFactory(categoryValueCount int) func() CVAccumulator
- func NewTreeNode(statistics CVAccumulator) *treeNode
- func ShuffleData(data []*Data)
- func StatAccumulatorFactory() func() CVAccumulator
- func TrainBag(data []*Data, classifier Classifier)
- type CVAccumulator
- type Classifier
- type Data
- type Ensemble
- type EntropyAccumulator
- func (ea *EntropyAccumulator) Add(category float64)
- func (ea *EntropyAccumulator) Clear()
- func (ea *EntropyAccumulator) Clone() ErrorAccumulator
- func (ea *EntropyAccumulator) Count() int
- func (ea *EntropyAccumulator) Dump(w io.Writer, indent int)
- func (ea *EntropyAccumulator) Estimate() float64
- func (ea *EntropyAccumulator) FrequencyEstimate(value float64) float64
- func (ea *EntropyAccumulator) Metric() float64
- func (ea *EntropyAccumulator) Remove(category float64)
- func (ea EntropyAccumulator) String() string
- type ErrorAccumulator
- type Feature
- type FeatureType
- type GrayWithFeatures
- type HierarchicalFeatures
- func (hf *HierarchicalFeatures) Centroid(r image.Rectangle) (xBar, yBar float64)
- func (hf *HierarchicalFeatures) Dump(w io.Writer)
- func (hf *HierarchicalFeatures) Edges(r image.Rectangle) (horizEdges, vertEdges float64)
- func (hf *HierarchicalFeatures) MassSums(r image.Rectangle) (mass, xMass, yMass int32, x2Mass, y2Mass, xyMass int64)
- func (hf *HierarchicalFeatures) RandomFeature(s int32) float64
- type RandomFeatureSelector
- type SplitInfo
- type StatAccumulator
- func (sa *StatAccumulator) Add(x float64)
- func (sa *StatAccumulator) Clear()
- func (sa *StatAccumulator) Clone() ErrorAccumulator
- func (sa *StatAccumulator) Count() int
- func (sa *StatAccumulator) Dump(w io.Writer, indent int)
- func (sa *StatAccumulator) Estimate() float64
- func (sa *StatAccumulator) Metric() float64
- func (sa *StatAccumulator) Remove(x float64)
- type Tree
- func (tree *Tree) Add(error float64)
- func (tree *Tree) Classify(featureSelector func(int32) float64) CVAccumulator
- func (tree *Tree) Depth() int
- func (tree *Tree) Dump(w io.Writer)
- func (tree *Tree) Estimate() float64
- func (tree *Tree) Leaves() int
- func (tree *Tree) SetFeaturesToTry(n int)
- func (tree *Tree) SetMaxDepth(depth int)
- func (tree *Tree) SetMinLeafSize(size int)
- func (tree *Tree) Size() int
- func (tree *Tree) Train(trainingSet []*Data)
- type WeightedCVAccumulator
- type WeightedErrorAccumulator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EntropyAccumulatorFactory ¶
func EntropyAccumulatorFactory(categoryValueCount int) func() CVAccumulator
func NewTreeNode ¶
func NewTreeNode(statistics CVAccumulator) *treeNode
func ShuffleData ¶
func ShuffleData(data []*Data)
func StatAccumulatorFactory ¶
func StatAccumulatorFactory() func() CVAccumulator
func TrainBag ¶
func TrainBag(data []*Data, classifier Classifier)
Types ¶
type CVAccumulator ¶
type CVAccumulator interface { ErrorAccumulator Remove(float64) Metric() float64 }
type Classifier ¶
type Data ¶
type Data struct {
// contains filtered or unexported fields
}
func (*Data) AppendFeatures ¶
type Ensemble ¶
type Ensemble struct {
// contains filtered or unexported fields
}
func NewEnsemble ¶
func NewEnsemble() *Ensemble
func (*Ensemble) AddClassifier ¶
func (te *Ensemble) AddClassifier(newClassifier Classifier)
type EntropyAccumulator ¶
type EntropyAccumulator struct {
// contains filtered or unexported fields
}
func NewEntropyAccumulator ¶
func NewEntropyAccumulator(categoryValueCount int) *EntropyAccumulator
func (*EntropyAccumulator) Add ¶
func (ea *EntropyAccumulator) Add(category float64)
func (*EntropyAccumulator) Clear ¶
func (ea *EntropyAccumulator) Clear()
func (*EntropyAccumulator) Clone ¶
func (ea *EntropyAccumulator) Clone() ErrorAccumulator
func (*EntropyAccumulator) Count ¶
func (ea *EntropyAccumulator) Count() int
func (*EntropyAccumulator) Estimate ¶
func (ea *EntropyAccumulator) Estimate() float64
func (*EntropyAccumulator) FrequencyEstimate ¶
func (ea *EntropyAccumulator) FrequencyEstimate(value float64) float64
func (*EntropyAccumulator) Metric ¶
func (ea *EntropyAccumulator) Metric() float64
func (*EntropyAccumulator) Remove ¶
func (ea *EntropyAccumulator) Remove(category float64)
func (EntropyAccumulator) String ¶
func (ea EntropyAccumulator) String() string
type ErrorAccumulator ¶
type GrayWithFeatures ¶
func (*GrayWithFeatures) Centroid ¶
func (gwf *GrayWithFeatures) Centroid() (x, y float64)
func (*GrayWithFeatures) Edges ¶
func (gwf *GrayWithFeatures) Edges() (vertical, horizontal float64)
imageEdges returns the average number of vertical and horizontal edges in the image. For vertical edges the average is taken over all rows. For horizontal edges the average is taken over all columns.
func (*GrayWithFeatures) Mass ¶
func (gwf *GrayWithFeatures) Mass() float64
func (*GrayWithFeatures) Moments ¶
func (gwf *GrayWithFeatures) Moments() (rxx, ryy, rxy float64)
func (*GrayWithFeatures) RandomFeature ¶
func (gwf *GrayWithFeatures) RandomFeature(s int32) float64
type HierarchicalFeatures ¶
func NewHierarchicalFeatures ¶
func NewHierarchicalFeatures(gs *image.Gray) *HierarchicalFeatures
func (*HierarchicalFeatures) Centroid ¶
func (hf *HierarchicalFeatures) Centroid(r image.Rectangle) (xBar, yBar float64)
func (*HierarchicalFeatures) Dump ¶
func (hf *HierarchicalFeatures) Dump(w io.Writer)
func (*HierarchicalFeatures) Edges ¶
func (hf *HierarchicalFeatures) Edges(r image.Rectangle) (horizEdges, vertEdges float64)
func (*HierarchicalFeatures) MassSums ¶
func (hf *HierarchicalFeatures) MassSums(r image.Rectangle) (mass, xMass, yMass int32, x2Mass, y2Mass, xyMass int64)
func (*HierarchicalFeatures) RandomFeature ¶
func (hf *HierarchicalFeatures) RandomFeature(s int32) float64
type RandomFeatureSelector ¶
type StatAccumulator ¶
type StatAccumulator struct {
// contains filtered or unexported fields
}
A new StatAccumulator may be declared without initialization. The Go default initialization is correct.
func (*StatAccumulator) Add ¶
func (sa *StatAccumulator) Add(x float64)
func (*StatAccumulator) Clear ¶
func (sa *StatAccumulator) Clear()
func (*StatAccumulator) Clone ¶
func (sa *StatAccumulator) Clone() ErrorAccumulator
func (*StatAccumulator) Count ¶
func (sa *StatAccumulator) Count() int
func (*StatAccumulator) Estimate ¶
func (sa *StatAccumulator) Estimate() float64
func (*StatAccumulator) Metric ¶
func (sa *StatAccumulator) Metric() float64
func (*StatAccumulator) Remove ¶
func (sa *StatAccumulator) Remove(x float64)
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
func NewTree ¶
func NewTree(accumulatorFactory func() CVAccumulator) *Tree
func (*Tree) Classify ¶
func (tree *Tree) Classify(featureSelector func(int32) float64) CVAccumulator
func (*Tree) SetFeaturesToTry ¶
func (*Tree) SetMaxDepth ¶
func (*Tree) SetMinLeafSize ¶
type WeightedCVAccumulator ¶
type WeightedCVAccumulator interface { WeightedErrorAccumulator Remove(cateogry, weight float64) Metric() float64 }
Click to show internal directories.
Click to hide internal directories.