Documentation
¶
Index ¶
- type Branch
- type DeepForest
- type Forest
- func (forest *Forest) AddDataRow(data []float64, class int, max int, newTrees int, maxTrees int)
- func (forest *Forest) BuildDeepForest() DeepForest
- func (forest *Forest) PrintFeatureImportance()
- func (forest *Forest) Save(folder string) (string, error)
- func (forest *Forest) Train(trees int)
- func (forest *Forest) TrainX(trees int)
- func (forest *Forest) Vote(x []float64) []float64
- func (forest *Forest) WeightVote(x []float64) []float64
- type ForestData
- type Tree
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Branch ¶
type Branch struct {
Attribute int
Value float64
IsLeaf bool
LeafValue []float64
Gini float64
GiniGain float64
Size int
Branch0, Branch1 *Branch
Depth int
}
Branch is tree structure of branches
type DeepForest ¶
type DeepForest struct {
Forest *Forest
ForestDeep Forest
Groves []Forest
NGroves int
NFeatures int
NTrees int
RandomFeatures [][]int
ResultFeatures [][]float64
Results []float64
}
DeepForest deep forest implementation where is standard forest, mini forests (Groves) and final ForestDeep (Forest + Groves)
func (*DeepForest) Train ¶
func (dForest *DeepForest) Train(groves int, trees int, deepTrees int)
Train DeepForest with parameters of number of groves, number of trees in groves, number of trees in final Deep Forest
func (*DeepForest) Vote ¶
func (dForest *DeepForest) Vote(x []float64) []float64
Vote return result of DeepForest
type Forest ¶
type Forest struct {
Data ForestData // database for calculate trees
Trees []Tree // all generated trees
Features int // number of attributes
Classes int // number of classes
LeafSize int // leaf size
MFeatures int // attributes for choose proper split
NTrees int // number of trees
NSize int // len of data
FeatureImportance []float64 //stats of FeatureImportance
}
Forest je base class for whole forest with database, properties of Forest and trees.
func (*Forest) AddDataRow ¶
AddDataRow add new data data: new data row class: result max: max number of data. Remove first if there is more datas. If max < 1 - unlimited newTrees: number of trees after add data row maxTress: maximum number of trees
This feature support Continuous Random Forest
func (*Forest) BuildDeepForest ¶
func (forest *Forest) BuildDeepForest() DeepForest
BuildDeepForest create DeepForest from Forest
func (*Forest) PrintFeatureImportance ¶
func (forest *Forest) PrintFeatureImportance()
PrintFeatureImportance print list of features
func (*Forest) WeightVote ¶
WeightVote use validation's weight for result
type ForestData ¶
type ForestData struct {
X [][]float64 // All data are float64 numbers
Class []int // Result should be int numbers 0,1,2,..
}
ForestData contains database