Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NaiveBayesClassifier ¶
type NaiveBayesClassifier struct {
// contains filtered or unexported fields
}
func NewNaiveBayesClassifier ¶
func NewNaiveBayesClassifier(model TrainedModelInterface) *NaiveBayesClassifier
func (*NaiveBayesClassifier) Classify ¶
func (c *NaiveBayesClassifier) Classify(tokenIDs []int64) entity.Prediction
Classify certain set of Token IDs. This slice CAN contains repeating values.
type TrainedModelInterface ¶
type TrainedModelInterface interface { // Returns the total samples count used in the model's training dataset GetSamplesCount() int64 // Returns map with classes frequencies () GetClassFrequency() result.ClassFrequency // Returns count of unique tokens in the model's training dataset GetUniqueTokensCount() int64 // Returns total tokens count in each class map[<Class ID> => <Tokens Count>] GetClassSizes() entity.ClassSizeMap // Returns token frequency (how much time each token was found in each class) GetTokenFrequency() result.TokenFrequency }
Click to show internal directories.
Click to hide internal directories.