Back to godoc.org

Package linear

v0.5.0
Latest Go to latest
Published: Mar 27, 2020 | License: Apache-2.0 | Module: github.com/jthomperoo/predictive-horizontal-pod-autoscaler

Index

Package Files

Constants

const Type = "Linear"

Type linear is the type of the linear predicter

type Config

type Config struct {
	StoredValues int `yaml:"storedValues"`
	LookAhead    int `yaml:"lookAhead"`
}

Config represents a linear regression prediction model configuration

type Predict

type Predict struct{}

Predict provides logic for using Linear Regression to make a prediction

func (*Predict) GetIDsToRemove

func (p *Predict) GetIDsToRemove(model *config.Model, evaluations []*stored.Evaluation) ([]int, error)

GetIDsToRemove provides the list of stored evaluation IDs to remove, if there are too many stored values it will remove the oldest ones

func (*Predict) GetPrediction

func (p *Predict) GetPrediction(model *config.Model, evaluations []*stored.Evaluation) (int32, error)

GetPrediction uses a linear regression to predict what the replica count should be based on historical evaluations

func (*Predict) GetType

func (p *Predict) GetType() string

GetType returns the type of the Prediction model

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier