decisionforest

package
v0.0.0-...-7d47eef Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: Apache-2.0, MIT Imports: 9 Imported by: 0

Documentation

Overview

Package decisionforest contains the engine inference code for decision forest models.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBit

func GetBit(bitmap []byte, i uint32) bool

GetBit gets the i-th bit in a bitmap.

func SetBit

func SetBit(bitmap []byte, i uint32)

SetBit sets the i-th bit in a bitmap.

Types

type ActivationSignature

type ActivationSignature func(value float32) float32

ActivationSignature is an activation function. Activation functions are applied on the output of Gradient Boosted Trees models.

type OneDimensionEngine

type OneDimensionEngine struct {
	Activation ActivationSignature
	// contains filtered or unexported fields
}

OneDimensionEngine is a specialization of the generic engine for models with a single output dimension.

func NewBinaryClassificationGBDTGenericEngine

func NewBinaryClassificationGBDTGenericEngine(model *gbt.Model, compatibility example.CompatibilityType) (*OneDimensionEngine, error)

NewBinaryClassificationGBDTGenericEngine creates an engine for a binary classification GBT model.

func NewBinaryClassificationRFGenericEngine

func NewBinaryClassificationRFGenericEngine(model *rf.Model, compatibility example.CompatibilityType) (*OneDimensionEngine, error)

NewBinaryClassificationRFGenericEngine creates an engine for a binary classification RF model.

func NewRankingGBDTGenericEngine

func NewRankingGBDTGenericEngine(model *gbt.Model, compatibility example.CompatibilityType) (*OneDimensionEngine, error)

NewRankingGBDTGenericEngine creates an engine for a regression GBT model.

func NewRegressionGBDTGenericEngine

func NewRegressionGBDTGenericEngine(model *gbt.Model, compatibility example.CompatibilityType) (*OneDimensionEngine, error)

NewRegressionGBDTGenericEngine creates an engine for a regression GBT model.

func NewRegressionRFGenericEngine

func NewRegressionRFGenericEngine(model *rf.Model, compatibility example.CompatibilityType) (*OneDimensionEngine, error)

NewRegressionRFGenericEngine creates an engine for a regression RF model.

func (*OneDimensionEngine) AllocateExamples

func (e *OneDimensionEngine) AllocateExamples(maxNumExamples int) *example.Batch

AllocateExamples allocates a set of examples.

func (*OneDimensionEngine) AllocatePredictions

func (e *OneDimensionEngine) AllocatePredictions(maxNumExamples int) []float32

AllocatePredictions allocates a set of predictions.

func (*OneDimensionEngine) Features

func (e *OneDimensionEngine) Features() *example.Features

Features of the engine.

func (*OneDimensionEngine) OutputDim

func (e *OneDimensionEngine) OutputDim() int

OutputDim is the output dimension of the engine.

func (*OneDimensionEngine) Predict

func (e *OneDimensionEngine) Predict(examples *example.Batch, numExamples int, predictions []float32)

Predict generates predictions with the engine.

type SetNodeSignature

type SetNodeSignature func(srcNode *dt.Node, dstNode *genericNode) error

SetNodeSignature is the signature of a method that set a leaf value during engine compilation.

Jump to

Keyboard shortcuts

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