Documentation ¶
Index ¶
- type GoldenLineSearch
- type GradientBoosting
- func (gb *GradientBoosting) Fit(X [][]float64, Y []float64, W []float64, XVal [][]float64, YVal []float64, ...) error
- func (gb GradientBoosting) MarshalJSON() ([]byte, error)
- func (gb GradientBoosting) Predict(X [][]float64, proba bool) ([]float64, error)
- func (gb *GradientBoosting) UnmarshalJSON(bytes []byte) error
- type LineSearcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GoldenLineSearch ¶
GoldenLineSearch implements Golden-section line-search.
func (GoldenLineSearch) Solve ¶
func (gls GoldenLineSearch) Solve(f func(x float64) float64) float64
Solve of GoldenLineSearch taken from https://www.wikiwand.com/en/Golden-section_search.
type GradientBoosting ¶
type GradientBoosting struct { xgp.GPConfig NRounds uint NEarlyStoppingRounds uint LearningRate float64 LineSearcher LineSearcher Loss metrics.DiffMetric RowSampling float64 ColSampling float64 Programs []xgp.Program Steps []float64 UsedCols [][]int ValScores []float64 TrainScores []float64 YMean float64 UseBestRounds bool MonitorEvery uint RNG *rand.Rand }
GradientBoosting implements gradient boosting on top of genetic programming.
func NewGradientBoosting ¶
func NewGradientBoosting( conf xgp.GPConfig, nRounds uint, nEarlyStoppingRounds uint, learningRate float64, lineSearcher LineSearcher, loss metrics.DiffMetric, rowSampling float64, colSampling float64, useBestRounds bool, monitorEvery uint, rng *rand.Rand, ) (*GradientBoosting, error)
NewGradientBoosting returns a GradientBoosting.
func (*GradientBoosting) Fit ¶
func (gb *GradientBoosting) Fit( X [][]float64, Y []float64, W []float64, XVal [][]float64, YVal []float64, WVal []float64, verbose bool, ) error
Fit iteratively trains a GP on the gradient of the loss.
func (GradientBoosting) MarshalJSON ¶
func (gb GradientBoosting) MarshalJSON() ([]byte, error)
MarshalJSON serializes a GradientBoosting.
func (GradientBoosting) Predict ¶
func (gb GradientBoosting) Predict(X [][]float64, proba bool) ([]float64, error)
Predict accumulates the predictions of each stored Program.
func (*GradientBoosting) UnmarshalJSON ¶
func (gb *GradientBoosting) UnmarshalJSON(bytes []byte) error
UnmarshalJSON parses a GradientBoosting.
type LineSearcher ¶
A LineSearcher finds a good enough step size to a gradient descent problem. f is the function we want to minimize given a step size.
Click to show internal directories.
Click to hide internal directories.