cart

package
v0.0.0-...-6ede810 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Gini

func Gini(y []float64) float64

Types

type CART

type CART struct {
	Root *DecisionNode
}

func LoadModel

func LoadModel(filename string) (*CART, error)

func NewCART

func NewCART() *CART

func (*CART) Fit

func (cart *CART) Fit(X [][]float64, y []float64)

func (*CART) Predict

func (cart *CART) Predict(X [][]float64) []float64

func (*CART) SaveModel

func (cart *CART) SaveModel(filename string) error

type DecisionNode

type DecisionNode struct {
	FeatureIndex int
	Threshold    float64
	Left         *DecisionNode
	Right        *DecisionNode
	Value        float64
	IsLeaf       bool
}

Jump to

Keyboard shortcuts

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