classifier

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2021 License: MIT Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LearningInstance

type LearningInstance interface {
	GetFeatureVector() feature.FeatureVector
	GetLabel() model.LabelType
}

type LearningInstances

type LearningInstances []LearningInstance

type MIRAClassifier

type MIRAClassifier struct {
	ModelType ModelType          `json:"ModelType"`
	Weight    map[string]float64 `json:"Weight"`
	C         float64            `json:"C"`
	Accuracy  float64            `json:"Accuracy"`
	Precision float64            `json:"Precision"`
	Recall    float64            `json:"Recall"`
	Fvalue    float64            `json:"Fvalue"`
}

func NewMIRAClassifier

func NewMIRAClassifier(modelType ModelType, instances LearningInstances, c float64) *MIRAClassifier

func NewMIRAClassifierByCrossValidation

func NewMIRAClassifierByCrossValidation(modelType ModelType, instances LearningInstances) (*MIRAClassifier, error)

func (MIRAClassifier) GetActiveFeatures

func (m MIRAClassifier) GetActiveFeatures() []string

func (MIRAClassifier) GetWeight

func (m MIRAClassifier) GetWeight(f string) float64

func (MIRAClassifier) Predict

func (m MIRAClassifier) Predict(features feature.FeatureVector) model.LabelType

func (MIRAClassifier) PredictScore

func (m MIRAClassifier) PredictScore(features feature.FeatureVector) float64

func (MIRAClassifier) SortByScore

func (m MIRAClassifier) SortByScore(examples model.Examples) model.Examples

type MIRAClassifierList

type MIRAClassifierList []MIRAClassifier

func (MIRAClassifierList) Len

func (l MIRAClassifierList) Len() int

func (MIRAClassifierList) Less

func (l MIRAClassifierList) Less(i, j int) bool

func (MIRAClassifierList) Swap

func (l MIRAClassifierList) Swap(i, j int)

type ModelType

type ModelType int
const (
	EXAMPLE ModelType = 0
	TWITTER ModelType = 1
)

Jump to

Keyboard shortcuts

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