Documentation
¶
Index ¶
- func RegisterClassificationPreload(v *vm.VM)
- type Class
- type Classifier
- func (c *Classifier) Classify(document []string) (Class, []float64, bool)
- func (c *Classifier) ClassifyProb(document []string) (Class, []float64, bool)
- func (c *Classifier) ConvertTermsFreqToTfIdf()
- func (c *Classifier) Learn(document []string, which Class)
- func (c *Classifier) Learned() int
- func (c *Classifier) LogScores(document []string) ([]float64, int, bool)
- func (c *Classifier) ProbScores(doc []string) ([]float64, int, bool)
- type KNN
- type LogisticRegression
- type Perceptron
- type SVM
- type SVMConfig
- type SVMKernel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Classifier ¶
type Classifier struct {
Classes []Class
DidConvertTfIdf bool
// contains filtered or unexported fields
}
func NewClassifier ¶
func NewClassifier(classes ...Class) *Classifier
func NewClassifierTfIdf ¶
func NewClassifierTfIdf(classes ...Class) *Classifier
func (*Classifier) Classify ¶
func (c *Classifier) Classify(document []string) (Class, []float64, bool)
func (*Classifier) ClassifyProb ¶
func (c *Classifier) ClassifyProb(document []string) (Class, []float64, bool)
func (*Classifier) ConvertTermsFreqToTfIdf ¶
func (c *Classifier) ConvertTermsFreqToTfIdf()
func (*Classifier) Learn ¶
func (c *Classifier) Learn(document []string, which Class)
func (*Classifier) Learned ¶
func (c *Classifier) Learned() int
func (*Classifier) LogScores ¶
func (c *Classifier) LogScores(document []string) ([]float64, int, bool)
func (*Classifier) ProbScores ¶
func (c *Classifier) ProbScores(doc []string) ([]float64, int, bool)
type LogisticRegression ¶
type LogisticRegression struct {
// contains filtered or unexported fields
}
func NewLogisticRegression ¶
func NewLogisticRegression(lr float64, epochs int) *LogisticRegression
func (*LogisticRegression) Fit ¶
func (m *LogisticRegression) Fit(features [][]float64, labels []string)
func (*LogisticRegression) Predict ¶
func (m *LogisticRegression) Predict(x []float64) string
func (*LogisticRegression) PredictProba ¶
func (m *LogisticRegression) PredictProba(x []float64) float64
type Perceptron ¶
type Perceptron struct {
// contains filtered or unexported fields
}
func NewPerceptron ¶
func NewPerceptron(lr float64, epochs int) *Perceptron
func (*Perceptron) Fit ¶
func (p *Perceptron) Fit(features [][]float64, labels []string)
func (*Perceptron) Predict ¶
func (p *Perceptron) Predict(x []float64) string
type SVM ¶
type SVM struct {
// contains filtered or unexported fields
}
func (*SVM) DecisionFunction ¶
func (*SVM) SupportVectorCount ¶
Click to show internal directories.
Click to hide internal directories.