package go_iforest
import "github.com/codegaudi/go-iforest"
Package go_iforest is an implementation of isolation forests as defined in https://cs.nju.edu.cn/zhouzh/zhouzh.files/publication/icdm08b.pdf.
Index ¶
- Constants
- Variables
- func PathLength(x []float64, T *Node, e int) float64
- type IForest
- func NewIForest(X [][]float64, trees int, subSamplingSize int) (*IForest, error)
- func (f *IForest) CalculateAnomalyScore(x []float64) float64
- type ITree
- type Node
Constants ¶
const EulersConstant = 0.5772156649
Variables ¶
var ( ErrTooLargeSubSamplingSize = errors.New("specified sub-sampling size is larger than amount of provided samples") ErrNoSamplesProvided = errors.New("no samples provided") )
Functions ¶
func PathLength ¶
PathLength derives the path length for an instance x using a Tree T e is the current path length (0 on the first call to this method)
Types ¶
type IForest ¶
func NewIForest ¶
NewIForest creates a new IForest and trains it on the provided data X make sure to call rand.Seed() before calling this function to ensure that a sufficiently random sub-sample is chosen.
func (*IForest) CalculateAnomalyScore ¶
CalculateAnomalyScore calculates an anomaly score based for a sample x
type ITree ¶
type ITree struct {
// contains filtered or unexported fields
}
func NewITree ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Source Files ¶
- Version
- v0.0.1 (latest)
- Published
- Jan 17, 2021
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 2 weeks ago –
Tools for package owners.