decisiontrees

package module
v0.0.0-...-512ff7a Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2013 License: MIT Imports: 10 Imported by: 0

README

decisiontrees

Gradient Boosting, Random Forests, etc. implemented in Go

Bitdeli Badge

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LearningCurve

func LearningCurve(f *pb.Forest, e Examples) *pb.TrainingResults

LearningCurve computes the progressive learning curve after each epoch on the given examples

Types

type Evaluator

type Evaluator interface {
	Evaluate(features []float64) float64
}

Evaluator implements the evaluator of a decision tree given a feature vector

func NewRescaledFastForestEvaluator

func NewRescaledFastForestEvaluator(f *pb.Forest) (Evaluator, error)

NewRescaledFastForestEvaluator returns an evalator for a tree that automatically corrects for various scaling factors required for a given evaluation

type EvaluatorFunc

type EvaluatorFunc func(features []float64) float64

EvaluatorFunc implements the Evaluator interface

func (EvaluatorFunc) Evaluate

func (f EvaluatorFunc) Evaluate(features []float64) float64

Evaluate is the implementation of Evaluator interface

type Examples

type Examples []*pb.Example

Examples is a slice of Example elements

func (Examples) String

func (e Examples) String() string

type FeatureSelector

type FeatureSelector interface {
	// contains filtered or unexported methods
}

FeatureSelector allows algorithms to configure which features to use for a given round of splitting

type ForestGenerator

type ForestGenerator interface {
	ConstructForest(e Examples) *pb.Forest
}

ForestGenerator is implemented by various algorithms that generate an ensemble of decision trees from the given training dataset.

func NewForestGenerator

func NewForestGenerator(forestConfig *pb.ForestConfig) (ForestGenerator, error)

NewForestGenerator returns a ForeestGenerator from the given ForestConfig.

type LossFunction

type LossFunction interface {
	UpdateWeightedLabels(e Examples)
	GetPrior(e Examples) float64
	GetLeafWeight(e Examples) float64
	GetSampleImportance(ex *pb.Example) float64
}

LossFunction is an arbitrary loss function used in computing decision trees

func NewLossFunction

func NewLossFunction(l *pb.LossFunctionConfig, evaluator Evaluator) LossFunction

NewLossFunction returns an implementation of `LossFunction` given the LossFunctionConfig

type TreeMapperFunc

type TreeMapperFunc func(t *pb.TreeNode, e Examples) (*pb.TreeNode, bool)

TreeMapperFunc returns the mapped node and a boolean representing whether we should continue traversal

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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