dt

package
v0.0.0-...-d942b2f Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2014 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DTGoLeft

func DTGoLeft(sample *core.MapBasedSample, feature_split core.Feature) bool

Types

type CART

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

CART is classification and regression tree, this class implement classification tree and use gini to split features

func (*CART) AppendNodeToTree

func (dt *CART) AppendNodeToTree(samples []*core.MapBasedSample, node *TreeNode, queue *list.List, tree *Tree, feature_select_prob float64)

func (*CART) FindBestSplitOfBinaryFeature

func (dt *CART) FindBestSplitOfBinaryFeature(samples []*core.MapBasedSample, node *TreeNode, feature_select_prob float64)

func (*CART) FindBestSplitOfContinusousFeature

func (dt *CART) FindBestSplitOfContinusousFeature(samples []*core.MapBasedSample, node *TreeNode, feature_select_prob float64)

func (*CART) Init

func (dt *CART) Init(params map[string]string)

func (*CART) LoadModel

func (self *CART) LoadModel(path string)

func (*CART) Predict

func (dt *CART) Predict(sample *core.Sample) float64

func (*CART) PredictMultiClass

func (dt *CART) PredictMultiClass(sample *core.Sample) *core.ArrayVector

func (*CART) RandByFeatureId

func (dt *CART) RandByFeatureId(fid int64) float64

func (*CART) SaveModel

func (self *CART) SaveModel(path string)

func (*CART) SingleTreeBuild

func (dt *CART) SingleTreeBuild(samples []*core.MapBasedSample, feature_select_prob float64, bootstrap bool) Tree

func (*CART) Train

func (dt *CART) Train(dataset *core.DataSet)

type CARTParams

type CARTParams struct {
	MaxDepth      int
	MinLeafSize   int
	GiniThreshold float64
	SamplingRatio float64
}

type GBDT

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

func (*GBDT) Init

func (c *GBDT) Init(params map[string]string)

func (*GBDT) LoadModel

func (self *GBDT) LoadModel(path string)

func (*GBDT) Predict

func (c *GBDT) Predict(sample *core.Sample) float64

func (*GBDT) RMSE

func (c *GBDT) RMSE(dataset *core.DataSet) float64

func (*GBDT) SaveModel

func (self *GBDT) SaveModel(path string)

func (*GBDT) Train

func (c *GBDT) Train(dataset *core.DataSet)

type RDTParams

type RDTParams struct {
	TreeCount   int
	MinLeafSize int
	MaxDepth    int
}

type RandomDecisionTree

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

func (*RandomDecisionTree) AppendNodeToTree

func (rdt *RandomDecisionTree) AppendNodeToTree(samples []*core.MapBasedSample, node *TreeNode, queue *list.List, tree *Tree)

func (*RandomDecisionTree) Init

func (rdt *RandomDecisionTree) Init(params map[string]string)

func (*RandomDecisionTree) LoadModel

func (self *RandomDecisionTree) LoadModel(path string)

func (*RandomDecisionTree) Predict

func (rdt *RandomDecisionTree) Predict(sample *core.Sample) float64

func (*RandomDecisionTree) PredictMultiClass

func (rdt *RandomDecisionTree) PredictMultiClass(sample *core.Sample) *core.ArrayVector

func (*RandomDecisionTree) RandomShuffle

func (rdt *RandomDecisionTree) RandomShuffle(features []core.Feature)

func (*RandomDecisionTree) SaveModel

func (self *RandomDecisionTree) SaveModel(path string)

func (*RandomDecisionTree) SingleTreeBuild

func (rdt *RandomDecisionTree) SingleTreeBuild(samples []*core.MapBasedSample) Tree

func (*RandomDecisionTree) Train

func (rdt *RandomDecisionTree) Train(dataset *core.DataSet)

type RandomForest

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

func (*RandomForest) Init

func (dt *RandomForest) Init(params map[string]string)

func (*RandomForest) LoadModel

func (self *RandomForest) LoadModel(path string)

func (*RandomForest) Predict

func (dt *RandomForest) Predict(sample *core.Sample) float64

func (*RandomForest) PredictMultiClass

func (dt *RandomForest) PredictMultiClass(sample *core.Sample) *core.ArrayVector

func (*RandomForest) SaveModel

func (self *RandomForest) SaveModel(path string)

func (*RandomForest) Train

func (dt *RandomForest) Train(dataset *core.DataSet)

type RandomForestParams

type RandomForestParams struct {
	TreeCount    int
	FeatureCount float64
}

type RegressionTree

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

func (*RegressionTree) AppendNodeToTree

func (dt *RegressionTree) AppendNodeToTree(samples []*core.MapBasedSample, node *TreeNode, queue *list.List, tree *Tree, select_features map[int64]bool)

func (*RegressionTree) FindBestSplit

func (dt *RegressionTree) FindBestSplit(samples []*core.MapBasedSample, node *TreeNode, select_features map[int64]bool)

func (*RegressionTree) GetElementFromQueue

func (dt *RegressionTree) GetElementFromQueue(queue *list.List, n int) []*TreeNode

func (*RegressionTree) GoLeft

func (dt *RegressionTree) GoLeft(sample *core.MapBasedSample, feature_split core.Feature) bool

func (*RegressionTree) Init

func (dt *RegressionTree) Init(params map[string]string)

func (*RegressionTree) LoadModel

func (self *RegressionTree) LoadModel(path string)

func (*RegressionTree) Predict

func (dt *RegressionTree) Predict(sample *core.Sample) float64

func (*RegressionTree) PredictBySingleTree

func (dt *RegressionTree) PredictBySingleTree(tree *Tree, sample *core.MapBasedSample) (*TreeNode, string)

func (*RegressionTree) SaveModel

func (self *RegressionTree) SaveModel(path string)

func (*RegressionTree) SingleTreeBuild

func (dt *RegressionTree) SingleTreeBuild(samples []*core.MapBasedSample, select_features map[int64]bool) Tree

func (*RegressionTree) Train

func (dt *RegressionTree) Train(dataset *core.DataSet)

type Tree

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

func (*Tree) AddTreeNode

func (t *Tree) AddTreeNode(n *TreeNode)

func (*Tree) FromString

func (t *Tree) FromString(buf string)

func (*Tree) GetNode

func (t *Tree) GetNode(i int) *TreeNode

func (*Tree) Size

func (t *Tree) Size() int

func (*Tree) ToString

func (t *Tree) ToString() []byte

type TreeNode

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

func DTGetElementFromQueue

func DTGetElementFromQueue(queue *list.List, n int) []*TreeNode

func PredictBySingleTree

func PredictBySingleTree(tree *Tree, sample *core.MapBasedSample) (*TreeNode, string)

func (*TreeNode) AddSample

func (t *TreeNode) AddSample(k int)

func (*TreeNode) ToString

func (t *TreeNode) ToString() string

Jump to

Keyboard shortcuts

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