anomaly

package
v0.0.0-...-e3597af Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2016 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAndGetScore

func AddAndGetScore(ctx *core.Context, stateName string, featureVector data.Map) (float32, error)

func CalcScore

func CalcScore(ctx *core.Context, stateName string, featureVector data.Map) (float32, error)

Types

type FeatureVector

type FeatureVector data.Map

FeatureVector represents a feature vector.

type ID

type ID uint32

ID is an identifier for a point.

type LightLOF

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

LightLOF holds a model for anomaly detection.

func LoadLightLOF

func LoadLightLOF(r io.Reader) (*LightLOF, error)

LoadLightLOF loads a LightLOF model.

func NewLightLOF

func NewLightLOF(nnAlgo NNAlgorithm, hashNum, nnNum, rnnNum, maxSize int, seed int64) (*LightLOF, error)

NewLightLOF creates a LightLOF model.

func (*LightLOF) Add

func (l *LightLOF) Add(v FeatureVector) (score float32, err error)

Add adds a feature vector to a LightLOF model and calculates its score.

func (*LightLOF) AddWithoutCalcScore

func (l *LightLOF) AddWithoutCalcScore(v FeatureVector) error

AddWithoutCalcScore adds a feature vector to a LightLOF model.

func (*LightLOF) CalcScore

func (l *LightLOF) CalcScore(v FeatureVector) (float32, error)

CalcScore calculates a score for a feature vector.

func (*LightLOF) Save

func (l *LightLOF) Save(w io.Writer) error

Save saves a LightLOF model.

type LightLOFStateCreator

type LightLOFStateCreator struct {
}

func (*LightLOFStateCreator) CreateState

func (c *LightLOFStateCreator) CreateState(ctx *core.Context, params data.Map) (core.SharedState, error)

func (*LightLOFStateCreator) LoadState

func (c *LightLOFStateCreator) LoadState(ctx *core.Context, r io.Reader, params data.Map) (core.SharedState, error)

type NNAlgorithm

type NNAlgorithm int

NNAlgorithm is an enum type which represents nearest neighbor algorithms.

const (
	// InvalidNNAlgorithm represents an invalid nearest neighbor algorithm.
	InvalidNNAlgorithm NNAlgorithm = iota
	// LSH represents locality sensitive hashing.
	LSH
	// Minhash represents minhash.
	Minhash
	// EuclidLSH represents locality sensitive hashing with euclidean distance.
	EuclidLSH
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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