classifier

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package classifier include different classifiers

Index

Constants

View Source
const (
	// NeuralMatchThreshold returns neural classifier match threshold
	NeuralMatchThreshold float64 = 0.75
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Classifier

type Classifier interface {
	Identity() ClassifierIdentity
	Train(people *core.People, split float64, iterations int, verbosity int)
	BatchTrain(people *core.People, split float64, iterations int, verbosity int, batch int)
	Predict(input []float32) []float64
	Match(input []float32) (int, float64)
	Write(io.Writer) error
	Read(io.Reader) error
}

Classifier represents classifier interface

func NewDefault

func NewDefault() Classifier

NewDefault returns a default Neural classifier

type ClassifierIdentity

type ClassifierIdentity int

ClassifierIdentity represents classifier type

const (
	// UnknownClassifier represents unknown classifier which is not defined
	UnknownClassifier ClassifierIdentity = iota
	// NeuralClassifier represents neural deep learning classifier
	NeuralClassifier
	// BayesClassifier represents bayes classifier
	BayesClassifier
)

type Neural

type Neural struct {
	// contains filtered or unexported fields
}

Neural represents neural classifier

func (*Neural) BatchTrain

func (n *Neural) BatchTrain(people *core.People, split float64, iterations int, verbosity int, batch int)

BatchTrain implement Classifier interface

func (*Neural) Identity

func (n *Neural) Identity() ClassifierIdentity

Name return sclassifier name

func (*Neural) Match

func (n *Neural) Match(input []float32) (int, float64)

Match returns best match result

func (*Neural) Predict

func (n *Neural) Predict(embedding []float32) []float64

Predict implement Classifier interface

func (*Neural) Read

func (n *Neural) Read(r io.Reader) error

Read implement Classifier interface

func (*Neural) SetThreadshold

func (n *Neural) SetThreadshold(threshold float64)

SetThreadshold set Neural match threshold

func (*Neural) Train

func (n *Neural) Train(people *core.People, split float64, iterations int, verbosity int)

Train implement Classifier interface

func (*Neural) Write

func (n *Neural) Write(w io.Writer) error

Write implement Classifier interface

Jump to

Keyboard shortcuts

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