Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MultiLinearSVC ¶
type MultiLinearSVC struct {
// contains filtered or unexported fields
}
MultiLinearSVC implements a multi-class Support Vector Classifier using a one-vs-all voting scheme. Only one CategoricalAttribute class is supported.
func NewMultiLinearSVC ¶
func NewMultiLinearSVC(loss, penalty string, dual bool, C float64, eps float64) *MultiLinearSVC
NewMultiLinearSVC creates a new MultiLinearSVC using the OneVsAllModel. The loss and penalty arguments can be "l1" or "l2". Typical values are "l1" for the loss and "l2" for the penalty. The dual parameter controls whether the system solves the dual or primal SVM form, true should be used in most cases. C is the penalty term, normally 1.0. eps is the convergence term, typically 1e-4.
func (*MultiLinearSVC) Fit ¶
func (m *MultiLinearSVC) Fit(instances base.FixedDataGrid) error
Fit builds the MultiLinearSVC by building n (where n is the number of values the singular CategoricalAttribute can take) seperate one-vs-rest models.
func (*MultiLinearSVC) Predict ¶
func (m *MultiLinearSVC) Predict(from base.FixedDataGrid) (base.FixedDataGrid, error)
Predict issues predictions from the MultiLinearSVC. Each underlying LinearSVC is used to predict whether an instance takes on a class or some other class, and the model which definitively reports a given class is the one chosen. The result is undefined if all underlying models predict that the instance originates from some other class.
type RandomForest ¶
type RandomForest struct { base.BaseClassifier ForestSize int Features int Model *meta.BaggedModel }
RandomForest classifies instances using an ensemble of bagged random decision trees.
func NewRandomForest ¶
func NewRandomForest(forestSize int, features int) *RandomForest
NewRandomForest generates and return a new random forests forestSize controls the number of trees that get built features controls the number of features used to build each tree.
func (*RandomForest) Fit ¶
func (f *RandomForest) Fit(on base.FixedDataGrid) error
Fit builds the RandomForest on the specified instances
func (*RandomForest) Predict ¶
func (f *RandomForest) Predict(with base.FixedDataGrid) (base.FixedDataGrid, error)
Predict generates predictions from a trained RandomForest.
func (*RandomForest) String ¶
func (f *RandomForest) String() string
String returns a human-readable representation of this tree.