Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Classifier ¶
type Classifier struct { Model *bayesian.Classifier Classes []bayesian.Class TfIdf bool }
Classifier is a Naïve-Bayes classifier
func Load ¶
func Load(directory string) (classifier *Classifier, err error)
func NewClassifier ¶
func NewClassifier(params map[string]interface{}) *Classifier
NewClassifier creates a Naive Bayes classifier with file data
func NewClassifierFromFile ¶
func NewClassifierFromFile(name string) (*Classifier, error)
func (*Classifier) Predict ¶
func (c *Classifier) Predict(text string, pipe *pipeline.Config) (predictedClass string, proba float32)
Predict predict a class for a given text
func (*Classifier) Save ¶
func (c *Classifier) Save(directory string) error
Save persists the model to a file
func (*Classifier) SaveToFile ¶
func (c *Classifier) SaveToFile(name string) error
type Parameters ¶
type Parameters struct {
TfIdf bool `mapstructure:"tfidf"`
}
Parameters represents the model hyperparameters
Click to show internal directories.
Click to hide internal directories.