algorithm_cart

package
v0.0.0-...-791d115 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2021 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CART

type CART struct {
	Scores []float64
	Trees  []*Tree
	// contains filtered or unexported fields
}

func (*CART) Accuracy

func (k *CART) Accuracy(predict []int64, labels []int64) float64

Accuracy calculates the quality metric

func (*CART) CrossValSplit

func (k *CART) CrossValSplit(data [][]float64) [][][]float64

CrossValSplit divides data into folds

func (*CART) CrossValidationScore

func (k *CART) CrossValidationScore(data [][]float64) float64

CrossValidationScore evaluates the algorithm on different partitions into training and test

func (*CART) InitAlgorithm

func (k *CART) InitAlgorithm(depth int, minCount int, countFold int)

InitAlgorithm shows tree in console

type Tree

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

Tree - main node

func (*Tree) Predict

func (t *Tree) Predict(features [][]float64) []int64

Predict makes a number of predictions based on the constructed tree

func (*Tree) PrintTree

func (t *Tree) PrintTree()

PrintTree shows tree in console

Jump to

Keyboard shortcuts

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