Skip to content

bn4t/go-iforest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-iforest

godocs.io

Golang implementation of Isolation Forest.

Example Usage

package main

import (
	go_iforest "github.com/codegaudi/go-iforest"
	"log"
	"math/rand"
	"time"
)


func main() {

	// load input data into two-dimensional slice
	var inputData [][]float64
	
	// seed the random generator before generating an isolation forest
	rand.Seed(time.Now().UnixNano())

	// generate an isolation forest with 10'000 trees and a sub-sampling size of 256
	f, err := go_iforest.NewIForest(inputData, 10000, 256)
	if err != nil {
		log.Fatal(err)
	}

	// calculate an anomaly score for a sample
	score := f.CalculateAnomalyScore(inputData[0])
}

License

MIT

About

Golang implementation of isolation forest.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages