classifier

package
v0.0.0-...-b2170da Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2020 License: MIT Imports: 3 Imported by: 0

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL